java - How to stretch a list view to the full screen in Android -
supose have layout oriented vertically 1 button in top, list view in middle, , button in bottom:
------ button listview listview listview ------
i make whole layout scrollable, able see full list when scrolling down it:
------ listview listview listview button ------
i think found it, here's solution you, without using scrollview
(which not needed):
<linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <button android:id="@+id/btn1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0"/> <listview android:id="@android:id/list1" android:layout_height="0dip" android:layout_width="match_parent" android:layout_weight="1" /> <listview android:id="@android:id/list2" android:layout_height="0dip" android:layout_width="match_parent" android:layout_weight="1" /> <listview android:id="@android:id/list3" android:layout_height="0dip" android:layout_width="match_parent" android:layout_weight="1" /> <button android:id="@+id/btn2" android:layout_width="match_parent" android:layout_height="wrap_content"/> </linearlayout>
Comments
Post a Comment