Code to set Header and Footer in your app

19 Jun

Note: Just create xml file copy n paste the code shown below. In my code i call the layouts such as “layout_header”, “layout_footer_menu” where as i have created another xml files such as “layout_header”, “layout_footer_menu” and written code as per my requirement for header and footer. Then just run the app to get success.

<xml version="1.0" encoding="utf-8">
<RelativeLayout xmlns:android=""


<strong><!-- HEADER --></strong>

<include android:id="@+id/top_header"
android:layout_alignParentTop="true" layout="@layout/layout_header"/>

<!-- FOOTER -->

<LinearLayout android:id="@+id/bottom_menu"

android:layout_width="fill_parent"         android:layout_height="wrap_content"

android:orientation="vertical" android:layout_alignParentBottom="true">

<!-- menu bar -->

<include layout="@layout/layout_footer_menu" />


<!-- MAIN PART -->

<LinearLayout android:orientation="vertical"

android:layout_width="fill_parent" android:layout_height="fill_parent"

android:layout_below="@id/top_header" android:layout_above="@id/bottom_menu"



android:paddingBottom="5sp" android:background="#EAEAEA">


Leave a comment

Posted by on June 19, 2012 in Android User Interface


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: