读书人

tabhost放毕竟部显示

发布时间: 2012-07-02 17:46:22 作者: rapoo

tabhost放到底部显示
主要原理:设置 TabWidget 控件的 android:layout_alignParentBottom="true" 实现。
<?xml version="1.0" encoding="utf-8"?>
  <TabHost android:id="@+id/tabhost" xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical" android:layout_width="fill_parent"
   android:layout_height="fill_parent">
   <RelativeLayout android:orientation="vertical"
   android:layout_width="fill_parent" android:layout_height="fill_parent">
   <TabWidget android:id="@android:id/tabs"
   android:layout_width="fill_parent" android:layout_height="wrap_content"
   android:layout_alignParentBottom="true" />
   <FrameLayout android:id="@android:id/tabcontent"
   android:layout_width="fill_parent" android:layout_height="fill_parent">
   <LinearLayout android:id="@+id/tab1"
   android:layout_width="fill_parent" android:layout_height="fill_parent"
   androidrientation="vertical">
   <TextView android:id="@+id/view1" android:layout_width="wrap_content"
   android:layout_height="wrap_content" android:text="@string/textView_1" />
   </LinearLayout>
   <LinearLayout android:id="@+id/tab2"
   android:layout_width="fill_parent" android:layout_height="fill_parent"
   androidrientation="vertical">
   <TextView android:id="@+id/view2" android:layout_width="wrap_content"
   android:layout_height="wrap_content" android:text="@string/textView_2" />
   </LinearLayout>
   <LinearLayout android:id="@+id/tab3"
   android:layout_width="fill_parent" android:layout_height="fill_parent"
   androidrientation="vertical">
   <TextView android:id="@+id/view3" android:layout_width="wrap_content"
   android:layout_height="wrap_content" android:text="@string/textView_3" />
   </LinearLayout>
   <LinearLayout android:id="@+id/tab4"
   android:layout_width="fill_parent" android:layout_height="fill_parent"
   androidrientation="vertical">
   <TextView android:id="@+id/view4" android:layout_width="wrap_content"
   android:layout_height="wrap_content" android:text="@string/textView_4" />
   </LinearLayout>
   </FrameLayout>
   </RelativeLayout>
  </TabHost>

读书人网 >操作系统

热点推荐