I want to change android:layout_height dynamically in ListView.
Actually, I'm using listview many places, But there it's height increasing automatically no need to set any value.
Just using this:
android:layout_height="wrap_content"
But this list view use in
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightSum="1"> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:id="@+id/llPRDeptHead" android:layout_height="wrap_content"> <TableLayout android:layout_width="wrap_content" android:layout_height="fill_parent" android:stretchColumns="1"> <!-- Item Detail Table --> <TableRow> <TableRow> <ListView android:layout_span="6" android:layout_width="fill_parent" android:layout_height="wrap_content" android:dividerHeight="2px" android:id="@+id/lvPRDeptHeadApproval" /> </TableRow> </TableLayout> </LinearLayout> </HorizontalScrollView> </ScrollView>