如何让Android选项卡与其他视图共存?
我需要有一个布局,上面有一组选项卡的视图。我已经让这些选项卡正常工作,但只要我尝试在它们之外添加一个视图,我就会留下该视图,并且没有可见的选项卡 这很好:如何让Android选项卡与其他视图共存?,android,user-interface,Android,User Interface,我需要有一个布局,上面有一组选项卡的视图。我已经让这些选项卡正常工作,但只要我尝试在它们之外添加一个视图,我就会留下该视图,并且没有可见的选项卡 这很好: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabHo
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<LinearLayout ... />
但这并不是:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView ... /> <!-- THIS LINE HERE!!! -->
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<LinearLayout ... />
如何使选项卡与其他视图共存
为了完整起见,我的活动将扩展。也许您应该摆脱最初的线性布局,从您的tabhost开始,就像这样?或者你的目标是建立一个如下图所示的设置
+-----------------+
| App Title |
+-----------------+
| some text |
+-----+-----+-----+
| tab | tab | tab |
+-----+-----+-----+
| |
事实上,据我所知,这是不可能的。Grr