2012-02-22 61 views
0

我有tabHost定位在视图的底部和tabHost带也出现在水龙头的底部。我想将条带放在标签上。怎么做?这是我的xml文件。谢谢。android get tabHost带顶

<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:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:orientation="vertical" > 

     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_weight="1" > 
     </FrameLayout> 

     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="fill_parent"      
      android:layout_height="wrap_content" 
      android:layout_weight="0" 
    /> 
    </LinearLayout> 

</TabHost> 

回答

0

尝试用这个..

 <?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" 
    android:padding="5dp"> 
    <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" 
     android:padding="5dp" /> 
</LinearLayout> 
</TabHost> 
+1

感谢,但不能正常工作,请注意标签是底部 – Jaume 2012-02-24 09:10:10