Reputation: 29867
In my ListView I have a footerview but its TextView is not expanding to the width of the parent. Here is my footer 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="wrap_content"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:id="@+id/tvShowMore"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Show more"
android:textSize="18sp" />
</LinearLayout>
And here is my code:
LayoutParams llParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
viewFooterShowMore.setLayoutParams(llParams);
lvEvents.addFooterView(viewFooterShowMore);
Upvotes: 0
Views: 489