主要使用:
设置为最顶部:android:layout_alignParentTop ="true"
设置为中部:
android:layout_above ="@+id/panelBottom" android:layout_below ="@+id/panelAbove"
注意layout_above设置的是底部id,layout_below设置的是顶部id
设置为最底部:android:layout_alignParentBottom ="true"
<?xml version="1.0" encoding= "utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
xmlns:fontawesometext="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<!--顶部设置android:layout_alignParentTop ="true" 和 id-->
<LinearLayout
android:id="@+id/panelAbove"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#87CEEB"
android:orientation="horizontal" >
<com.beardedhen.androidbootstrap.FontAwesomeText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:textSize="32sp"
fontawesometext:fa_icon="fa-qq" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@color/black"
android:text="more"
/>
</LinearLayout >
<!--中部设置
android:layout_above ="@+id/panelBottom" android:layout_below ="@+id/panelAbove"
注意layout_above设置的是底部id,layout_below设置的是顶部id
-->
<LinearLayout
android:id="@+id/panelCenter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/panelBottom"
android:layout_below="@+id/panelAbove"
android:orientation="vertical" >
<com.baoyz.swipemenulistview.SwipeMenuListView
android:id="@+id/qqlist_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout >
<!--顶部设置android:layout_alignParentBottom ="true" 和 id-->
<LinearLayout
android:id="@+id/panelBottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:layout_margin="1dp"
android:background="#87CEEB"
android:gravity="center"
android:orientation="horizontal" >
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/main_button_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="主页"
bootstrapbutton:bb_icon_left="fa-home"
bootstrapbutton:bb_roundedCorners="true"
bootstrapbutton:bb_type="info" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/main_button_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="登录"
bootstrapbutton:bb_icon_left="fa-plus"
bootstrapbutton:bb_roundedCorners="true"
bootstrapbutton:bb_type="info" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/main_button_exit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="退出"
bootstrapbutton:bb_icon_left="fa-times"
bootstrapbutton:bb_roundedCorners="true"
bootstrapbutton:bb_type="info" />
</LinearLayout >
</RelativeLayout>