android - Add a full width header item to a Grid View in AbsListView (Xamarin) -
i have list in app, , it's implemented abslistview, when working on smaller screen (phone) it's list , when on larger screen (tablet) it's grid. works well.
now want add in header item different regular items on list - has different xml file. it's first item in list.
i've added in code adapter class so:
public override view getview(int position, view convertview, viewgroup parent) { savedinfo subviews = null; var rowview = convertview; var channel = items[position]; // don't want reuse if our previous view header if (rowview?.tag != null) { subviews = rowview.tag savedinfo; } // try put in different view if there header shown // special id value header -1 if (position == 0) { subviews = null; } if (subviews == null) { if (position == 0) { rowview = context.activity.layoutinflater.inflate(resource.layout.header_layout, null); // setup stuff layout rowview.tag = null; return rowview; } rowview = context.activity.layoutinflater.inflate(celllayout, null); // stuff regular layout, take savedinfo tag rowview.tag = subviews; } // other adjustments regular layout return rowview; }
so that's fine in regular list - have 1 header item , lots of regular items. however, when switch gridview (which uses same adapter) "header" item first cell in grid.
what want more or less same in list view - single column fills width of screen, followed regular grid. point want item fills columns across, scrolls grid. there way this? understand might need replace sort of custom adapter view. have example of code doing grid 1 item filling multiple grid columns?
thanks
turns out not possible - recommended way put in header use coordinatorlayout , collapsingtoolbarlayout while changing listview recyclerview
Comments
Post a Comment