android - Scroll layout containing listview -
i have listview
contains 600 elements, right above have 2 spinners use filter list. possible make when start scrolling down listview, first scroll entire page hide 2 spinners before start scrolling actual listview.
(the red box framelayout)
i've sketched out current layout along desired effect. start seeing 2 spinners, single list item use header listview, , listview itself. when start scrolling, want first spinners dissapear under toolbar, , start items scroll.
is possible? if not, alternatives display list filtering controls while not occupying of screen?
edit: i've started experimenting nestedscrollview, , sorta works. here layout:
<android.support.v4.widget.nestedscrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="16dp"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="20dp"/> <spinner android:id="@+id/spinner2" android:layout_width="fill_parent" android:layout_height="20dp"/> <include android:id="@+id/header_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" layout="@layout/team_ratings_item" /> <listview android:id="@+id/lvteams" android:layout_width="match_parent" android:layout_height="wrap_content"> </listview> </linearlayout> </android.support.v4.widget.nestedscrollview>
but layout, listview appears 1 line scrollable. if set it's height high, 6000dp, want... there way set it's height correctly?
android didn't allowed have scrollable view (e.g., listview) inside scrollview
.
recently, support library has nestedscrollview. solve issue replace scrollview
nestedscrollview
in xml layout file.
Comments
Post a Comment