我在我的機器人應用此佈局文件:線性佈局內TabHost僅示出一個元件
<?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">
<LinearLayout
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"
android:layout_weight="1">
<TextView
android:id="@+id/textview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is a tab" />
<TextView
android:id="@+id/textview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is another tab" />
<LinearLayout
android:id="@+id/layoutSearch"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/textview4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Search here" />
<EditText
android:id="@+id/editSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"/>
</LinearLayout>
</TabHost>
我的問題是LinearLayout android:id="@+id/layoutSearch"
僅示出它包含的元素中的一個(文本視圖,在上面的代碼)如果我刪除了textview,它會顯示EditText。
我如何讓它顯示兩個(及以上)的元素?
我知道這可能看起來像我複製一個iPhone應用程序,但IMO這使得它更容易看清屏幕的其餘部分,當他們在上面你的手覆蓋整個屏幕.. – networkprofile 2011-04-26 16:11:42
你說得對,也許我應該把它動起來,我會考慮的 – networkprofile 2011-04-26 16:25:24