布局中主要是定义了 android:layout_alignParentBottom="true"该属性。
android:layout_weight="1"和这个属性。
开始的时候是菜单不会贴着底部显示。而是在屏幕内容之后。
后来改了一下属性。将高度全部变为了沾满而不是包裹。就可以贴着底部显示了
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/hometabs"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TabHost
android:background="#ffffff"
android:id="@+id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
//这里采用显性布局
<LinearLayout
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_weight="1"
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ListView
android:id="@+id/view1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:dividerHeight="5dip" />
<LinearLayout
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:text="CAODAN"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<TextView
android:text="CAODAN"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
<TextView
android:id="@+id/view3"
android:text="disange?"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
<TabWidget
android:background="#ffffff"
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</TabWidget>
</LinearLayout>
</TabHost>
</LinearLayout>