I have a listview with just a few items in one of my fragments, and the rows don't take up the full screen. The container is supposed to have a white background, but all the empty space underneath the last row is colored black, and I can't seem to figure out a way to fix it.
Layout:
<?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:background="#FFFFFFFF"
android:orientation="vertical">
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="#D0D0D0"
android:dividerHeight="1px" />
</LinearLayout>
OnCreateView:
#region OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View view = inflater.Inflate (Resource.Layout.JurisdictionListLayout, null, false);
return view;
}
#endregion
OnActivityCreated:
#region OnActivityCreated
public override void OnActivityCreated (Bundle savedInstanceState)
{
base.OnActivityCreated (savedInstanceState);
// Grab all the jurisdiction names and load them
m_Jurisdictions = new List<string>() { "United States", "United Kingdom", "France", "Germany", "Italy", "Qatar", "Russia", "Saudi Arabia", "Singapore", "Spain", "United Arab Emirates" };
this.ListAdapter = new ArrayAdapter<string> (this.Activity, m_Jurisdictions);
this.ListView.OverscrollFooter = null;
}
#endregion
Result:
Anyone know how to make the empty space beneath the short list either white or transparent? Or a different layout to help me achieve the same thing.
If you need additional information or code let me know, didn't want to post too much.
Thanks!
Edit: My fragment inherits from ListFragment - I wonder if I shouldn't inherit from Fragment and use a custom listview instead of the built-in one?