I am adding footer to listview using,
View footerview = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.footer_social, null, false);
listview_followers.addFooterView(footerview);
Here is my listview in xml
<ListView
android:id="@+id/listview_followers"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
And footerview xml :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
android:id="@+id/btnSend_social"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/botao_bgg"
android:text="SEND"
android:textColor="#ffffff"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
footerview.xml successfully added if there are items in listview. If there are no items in listview, footerview is also not displayed.
Can anybody help about this?