Android add a ListView inside of ScrollView -
i know bad practice "don't put listview scrollview" since listview has it's own scroll. however, have couple of other items (buttons , textviews) additional listview. those, need use scrollview. found solution (http://nex-otaku-en.blogspot.com/2010/12/android-put-listview-in-scrollview.html) prevent collapsing listview. but, said, need scrollview encapsulates items on xml form. have added xml code, please guide how achieve this.
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <listview android:id="@+id/listview1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:choicemode="singlechoice"> </listview> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <button android:id="@+id/button1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="button1" /> </linearlayout> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/longtext" /> </linearlayout> </scrollview>
listview scrollable. not put listview inside scroll view.
move listview outside scorllview. can add header , footer listview.
check video google
Comments
Post a Comment