Я пытаюсь использовать TabHost и TabWidget в моем приложении для Android. Это мой макет main.xml:
<TabHost
android:id="@+id/mainTabHost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="65px"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/contentTags"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:id="@+id/contentPreferences"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
</LinearLayout>
</FrameLayout>
</TabHost>
И мой код:
final TabHost mainTabHost = (TabHost) this.findViewById(R.id.mainTabHost);
mainTabHost.setup();
final TabHost.TabSpec tabSpecTags = mainTabHost.newTabSpec("tabTags");
tabSpecTags.setIndicator(this.getString(R.string.tab_name_tags));
tabSpecTags.setContent(R.id.contentTags);
mainTabHost.addTab(tabSpecTags);
final TabHost.TabSpec tabSpecPreferences = mainTabHost.newTabSpec("tabPreferences");
tabSpecPreferences.setIndicator(this.getString(R.string.tab_name_preferences));
tabSpecPreferences.setContent(R.id.contentPreferences);
mainTabHost.addTab(tabSpecPreferences);
Проблема в том, что я не хочу, чтобы мои вкладки были такими высокими (65 пикселей). Однако, если я установлю layout_height TabWidget, например, на. 30 пикселей, я вообще не вижу метки вкладок (индикатор) на вкладках.
Похоже, что есть минимальная необходимая высота для TabWidget (65px?), А индикатор расположен внизу этого 65px?
Есть ли способ отрегулировать положение индикатора?
Спасибо!