java - ListView header -
i create header layout (xml file) take whole 1 screen layout...
and created listview , added header_layout listview:
layoutinflater inflater = getlayoutinflater(); final view headerl = inflater.inflate(r.layout.header, null); swipelistview.addheaderview(headerl, null, false);
the listview under header layout.
however, header stretched on whole page , when try scroll header ( scroll down see listview), doesnt scroll down..
the headerview not scrollable , therefore cant reach listview...
is there implementation it? or make header scrollable?
the listview not empty , checked via debug mode
also, if remove headerview listview (my page containes listview, without header) show me listview well
thanks alot
if wish header scrollable other views, can implement method baseadapter.getitemviewtype , first position, return type of header, , rest, type of normal types.
then, in getview method, check type inflate/re-use , , fill needed data when needed.
example:
@override public int getitemviewtype(final int position) { return position==0?0:1; } @override public view getview(final int position, final view convertview, final viewgroup parent) { int rowtype=getitemviewtype(position); if(rowtype==0) { //handle header (don't forget use convertview) } else { //handle simple row (don't forget use convertview , use correct item) } }
for more tips regarding listview, check out "the world of listview" lecture.
Comments
Post a Comment