我想用在每個選項卡不止一個CheckBox
,但只有一個框顯示了在該選項卡,即使我有三個的LinearLayout下。這種佈局或它的父佈局可能是無用的(機器人)
予設定的ID爲每個複選框也。
以下是正在使用的代碼。
main.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" >
<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="fill_parent" >
<LinearLayout
android:id="@+id/widget43"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<CheckBox
android:id="@+id/root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Tortillas" />
<CheckBox
android:id="@+id/root1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Tortillas1" />
<CheckBox
android:id="@+id/roo2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Tortillas2" />
</LinearLayout>
</FrameLayout>
</TabHost>
後的線性佈局這究竟是怎麼編? LinearLayout沒有高度屬性。 –
@ZedScio是我做錯的唯一事情嗎?謝謝。 –
標籤中只顯示一個複選框? –