1
누군가 센터 탭에서 어떻게 이미지를 설정했는지 알 수 있습니까? xml을 변경하려고했지만 작동하지 않았습니다. 내 XML 아래어떻게 센터 탭 호스트에서 이미지를 설정할 수 있습니까?
:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</TabHost>
내 코드의 활동 아래 :
@SuppressWarnings("deprecation")
final
TabHost tabHost = getTabHost();
// Tab 1
TabSpec aba1spec = tabHost.newTabSpec("Tab 1");
// setting Title and Icon for the Tab
tabHost.getTabWidget().setStripEnabled(false);
aba1spec.setIndicator("",getResources().getDrawable(R.drawable.tab1));
Intent tab1 = new Intent(this, tab1.class);
aba1spec.setContent(tab1);
// Adding all TabSpec to TabHost
tabHost.addTab(aba1spec); // Adding tab1
이미지 :
고마워요.
내가 내 게시물 메드을 편집, 난 내 활동에 예를 적용하는 방법을 이해하지 않습니다. – lfrancatto
어떤 부분을 얻지 못하셨습니까? –
부품 번호 2. 나는 탭을 위해 특정한 활동을 하나 생성해야합니까? 내 게시물이 같은가요? – lfrancatto