I have already searched, but, unfortunately, have not found a real solution to this. I added a footer to the list view with:
View footer = getLayoutInflater().inflate(R.layout.listfooter, null); listview.addFooterView(footer);
The XML for the footer is as follows:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/footer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="#FFFFFFFF" android:orientation="vertical" android:layout_alignParentBottom="true" android:background="#ee222222" > <TextView android:id="@+id/info" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Test Test Test" android:layout_alignParentBottom="true" android:layout_gravity="center_vertical" /> </LinearLayout>
It displays the footer as a single line only
I am changing the number of lines in the list dynamically, but I want the footer to always fill the rest of the list if there are not enough elements in it.
How can i do this?
Change: I added an image, on the left - as it is now, and on the right - 2.
source share