0
我想創建一個簡單的TabActivity,並遵循開發人員網站上的教程。實施工作正常,但佈局困擾我。首先,文本是白色的,背景是白色和灰色時,背景是灰色時。我認爲常規行爲會是相反的。但是這個底部的這條白線也應該連接不同的標籤。爲什麼我的TabWidget看起來不像它應該的樣子?
這裏是我的佈局:
常規選項卡布局
<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>
這就是,它的外觀現在: