Following is my XML code. Please ignore the colors. I put them there for testing
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ff0000">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="match_parent" android:background="#ffffff">
<TabHost android:id="@+id/distributionTabhost" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="match_parent" android:background="#00ff00" />
<FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="match_parent" android:background="#ff0000">
<LinearLayout android:id="@+id/ITCCGListContainer" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<ListView android:id="@+id/ITCCGList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1"
android:drawSelectorOnTop="false" android:background="#00ff00"/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
</ScrollView>
When I use this for an activity, the listview’s height is very small and not occupying the remaining blank space. What I want is the Listview to occupy as much space as required for its contents and have the whole Activity scroll. For that i have enclosed the whole thing in a scrollview.
Thanks
You should set the
android:fillViewport="true"property for yourScrollView, so it to fit the screen partition dedicated for yourActivity.