1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="fill_parent" 4 android:layout_height="fill_parent" 5 android:orientation="vertical" > 6 7 <TabHost 8 android:id="@android:id/tabhost" 9 android:layout_width="fill_parent" 10 android:layout_height="fill_parent" > 11 12 <!-- TabWidget默认置于FrameLayout之上,使用LinearLayout可以将其置于FrameLayout之下。且没加这个LinearLayout,标签和内容页会重叠 --> 13 <LinearLayout 14 android:layout_width="fill_parent" 15 android:layout_height="fill_parent" 16 android:gravity="center" 17 android:orientation="vertical" > 18 19 20 21 <FrameLayout 22 android:id="@android:id/tabcontent" 23 android:layout_width="fill_parent" 24 android:layout_height="wrap_content" 25 android:layout_gravity="center_vertical" 26 android:layout_weight="1" 27 android:gravity="center_vertical" > 28 </FrameLayout> 29 30 <TabWidget 31 android:id="@android:id/tabs" 32 android:layout_width="fill_parent" 33 android:layout_height="52dip" 34 android:layout_weight="0"> 35 </TabWidget> 36 37 38 39 </LinearLayout> 40 </TabHost> 41 42 43 44 </LinearLayout>