Android: header in a ListView -
i have header on top of listview
, in way if user scrolls down listview, header stack top of view (right below of action bar).
i created relativelayout
include linearlayout
header , below it, listview, still when listview scrolled down, header disappears. tried addheaderview
no luck yet.
can throw light here?
edit: layouts this:
<include android:id="@+id/includefilterszoekandboek" android:layout_above="@+id/acommodatieslistview" layout="@layout/filters_header_layout" /> <listview android:id="@+id/acommodatieslistview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@+id/loadmoreaccommodaties" android:layout_alignparenttop="true" android:scrollingcache="false" > </listview> <button android:id="@+id/loadmoreaccommodaties" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:text="laad meer resultaten..." android:visibility="gone" />
and header:
<linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="populariteit" /> <imagebutton android:layout_width="15dip" android:layout_height="15dip" android:src="@drawable/triangle" /> <imagebutton android:layout_width="15dip" android:layout_height="15dip" android:src="@drawable/triangle" /> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="prijs" /> <imagebutton android:layout_width="15dip" android:layout_height="15dip" android:src="@drawable/triangle" /> <imagebutton android:layout_width="15dip" android:layout_height="15dip" android:src="@drawable/triangle" /> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="rating" /> </linearlayout>
now, seems ok, problem listview
below header, , when scrolling down, can see header on top of items of listview
.
with requirements, dont need set header view listview, because headers scrollable other contents of list.
in case, add view on top (above) of listview should act header. stay there if scroll list.
Comments
Post a Comment