The code below is for a ListView with a footer, the problem I am facing is that the lower entries in the ListView are getting overlapped by the footer.
So Could you suggest any solution (because I tried a lot and it each situation I am getting the same overlapping result) or some other way to do it. Thanks in advance. I have also posted the code of the footer just in case.
<LinearLayout android:id="@+id/homeParentLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:layout_height="wrap_content"
android:layout_width="fill_parent" android:id="@+id/listV_main"
android:listSelector="@android:color/transparent"/>
<include android:id="@+id/footer" android:layout_height="wrap_content"
layout="@layout/mymenu" android:layout_width="fill_parent"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true">
</include>
</RelativeLayout>
</LinearLayout>
Code for mymenu.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_gravity="bottom">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:orientation="vertical">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal">
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
<ImageView
android:id="@+id/imgSetting"
android:src="@drawable/settings_gear_icon_256"
android:layout_width="60dip"
android:layout_height="60dip"
android:layout_marginLeft="10sp"
android:clickable="true"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
<ImageView
android:id="@+id/imgLogin"
android:layout_width="60dip"
android:src="@drawable/login_lock_256"
android:clickable="true"
android:layout_height="60dip" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=" "
android:gravity="center"/>
</TableRow>
</TableLayout>
</LinearLayout>
Use a relative layout like this:
Declare the relative layout, then declare the footer as the first element.
These properties are the important ones for the footer:
Then declare your listView with this property:
And that should do it.