我需要一个布局,在一组选项卡上方有一个视图。我已经让选项卡正常工作了,但是当我试图在它们之外添加一个视图时,我只剩下这个视图,并且没有可见的选项卡。
这样做很好:
<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 ... />我怎样才能使我的标签与其他视图共存?
为了完整起见,我的活动扩展了TabActivity。
发布于 2010-08-05 09:37:35
事实上,根据这篇文章的说法,这是不可能的。老爹。
发布于 2010-08-04 09:41:17
也许您应该去掉初始的LinearLayout,从您的表主机开始,就像在这个教程中一样?或者你的目标是设置一个像下面的图片?
+-----------------+
| App Title |
+-----------------+
| some text |
+-----+-----+-----+
| tab | tab | tab |
+-----+-----+-----+
| |https://stackoverflow.com/questions/3404024
复制相似问题