2010-09-30 26 views
2

如何設置頁腳每一頁如何在Android的設置頁腳的Android

我已經使用上:

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:background="@color/mcolor" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_gravity="fill"> 

<ImageButton android:id="@+id/iconbtn" 
      android:layout_height="wrap_content" 
      android:src="@drawable/all_icon_138" 
      android:layout_marginRight="4px" 
      android:layout_gravity="fill" 
      android:clickable="true" 
      android:layout_width="wrap_content" 
      android:background="@color/mcolor" 
      android:layout_marginLeft="60px" 
      android:layout_marginTop="12px" android:saveEnabled="true"> 
</ImageButton> 
<TextView android:text="@+id/TextView01" 
    android:id="@+id/label" 
    android:textColor="@color/mbcolor" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:scrollbars="vertical" 
    android:layout_marginBottom="30px" 
    android:layout_marginTop="30px" 
    android:textSize="12px" 
    android:layout_marginRight="30px" 
    android:layout_marginLeft="130px"></TextView> 
<LinearLayout android:layout_marginTop="50dip" 
    android:gravity="bottom" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:layout_alignParentBottom="true"> 
    <ImageButton android:id="@+id/previous" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/newfox_footer_320" 
      android:layout_alignParentBottom="true" 
      android:layout_alignParentRight="false" 
       android:layout_alignParentLeft="false" android:layout_marginLeft="190px" android:layout_marginRight="2px"> 
      </ImageButton></LinearLayout> 
</RelativeLayout> 

這是顯示各TextView後軀的6幅圖像。 我該如何設置它?

+0

看看這個: [添加頁腳到列表視圖] [1] [1]:http://stackoverflow.com/questions/4265228/how-to-add-footer-in-list-view/4265324#4265324 – Shaireen 2011-11-03 06:38:50

回答

2

它不清楚你到底想要什麼,但我想你想要一個佈局的頁腳。

使用FrameLayout裏,你主要佈局與

width = fillparent 
height = fillparent 

採取另外的FrameLayout設置重力底部。 將視圖添加到此framelayout。 這是你的頁腳。

1

讓XML佈局一個的RelativeLayout根視圖。 那麼你一定要爲頁腳,或他的父母(一個誰是根視圖元素的直接子:RelativeLayout的)視圖需要有這個屬性: 機器人:layout_alignParentBottom =「真」