簡単なTabActivityを作成し、開発者サイトのチュートリアルに従います。実装は正常に機能しますが、レイアウトが気になります。まず、背景が白と灰色の場合、背景が灰色の場合、テキストは白です。通常の振る舞いは逆だと思いました。ただし、下部にあるこの1つの白い線は、さまざまなタブを接続する必要があります。
これが私のレイアウトです:
一般的なタブレイアウト
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</TabHost>
<include layout="@layout/menu_back_only" />
</LinearLayout>
Selectos
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/menu_home"
android:state_selected="true" />
<item
android:drawable="@drawable/menu_logout" />
</selector>
そして、これは、それが今どのように見えるかです: