2010-08-04 55 views
1

我需要有一个布局,其上方有一组标签。我已经得到了标签工作正常,但只要我尝试在他们之外添加一个视图,我留下了该视图,没有可见的选项卡。如何让Android标签与其他视图共存?

这工作得很好:

<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

回答

0

实际上,根据this article,这是不可能的。格儿。

0

Mayby你应该摆脱最初的LinearLayout并从你的tabhost开始,像这样的tutorial?或者你的目标是像下面的图片一样设置?

+-----------------+ 
| App Title  | 
+-----------------+ 
| some text  | 
+-----+-----+-----+ 
| tab | tab | tab | 
+-----+-----+-----+ 
|     | 
+0

是的,那是我的目标。 – 2010-08-04 10:38:42