- <?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">
- <!-- 实现Tab标签的居底主要是通过设置属性 android:layout_weight="1" -->
- <!-- 还要注意FrameLayout标签的位置,要写在TabWidget标签的前面 -->
- <FrameLayout
- android:id="@android:id/tabcontent"
- android:layout_weight="1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
- <TabWidget
- android:id="@android:id/tabs"
- android:layout_alignParentBottom="true"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
- </LinearLayout>
- </TabHost>
<!-- 实现Tab标签的居底主要是通过设置属性 android:layout_weight="1" -->
<!-- 还要注意FrameLayout标签的位置,要写在TabWidget标签的前面 -->
转载于:https://blog.51cto.com/whatandroid/1007107