2

How to set footer in android on each page

I have used:

<?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>

It is showing 6 images of footer after each TextView. How do I set it?

DonGru
  • 13,532
  • 8
  • 45
  • 55
kites
  • 21
  • 1
  • 2
  • 5
  • check out this : [Add footer to list view][1] [1]: http://stackoverflow.com/questions/4265228/how-to-add-footer-in-list-view/4265324#4265324 – Shaireen Nov 03 '11 at 06:38

3 Answers3

2

its is not clear what do you exactly want but i assume you want a footer in a layout.

use a framelayout as you main layout with

width = fillparent
height = fillparent

take another framelayout set the gravity to bottom. add views to this framelayout. this is your footer.

DonGru
  • 13,532
  • 8
  • 45
  • 55
Umesh
  • 4,406
  • 2
  • 25
  • 37
1

Make the root view of your xml Layout a RelativeLayout. Then the view you want as footer, or his parent (the one who is direct child of the root view element: RelativeLayout) needs to have this attribute: android:layout_alignParentBottom="true"

SuppressWarnings
  • 4,134
  • 4
  • 25
  • 33
0

You've used LinearLayout for footer, so you can check out stackoverflow: footer for linear layout in android

Community
  • 1
  • 1
Ikrom
  • 4,785
  • 5
  • 52
  • 76