Just use multiple RelativeLayouts.
Create your header layout (50dp or something else) matching the parent top. Then create a second layout aligned at the bottom of the page (this will be your footer). Then add another layout below the βheaderβ and βaboveβ the footer that your GridView will contain.
It should look like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <RelativeLayout android:id="@+id/header" android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignParentTop="true" > /* ANYTHING YOU WANT IN YOUR HEADER */ </RelativeLayout> <RelativeLayout android:id="@+id/gridview" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_below="@+id/header" android:layout_above="@+id/footer" > /* GRIDVIEW HERE */ </RelativeLayout> <RelativeLayout android:id="@+id/footer" android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignParentBottom="true" > /* ANYTHING YOU WANT IN YOUR FOOTER */ </RelativeLayout> </RelativeLayout>
Hope this helps.
source share