Reputation: 1610
Im trying to implement a GridView with section headers. I found one other question here Android GridView with categories? , however following the accepted answer gives me "header" as cells instead of the header being in its own row.
Im not sure what Im missing here (have tried the MergeAdapter too), can someone point out the nuance thats needed to implement the section headers in a GridView ?
Upvotes: 3
Views: 10518
Reputation: 579
Try modifying the usual listview adapter to return grid cells see here
Upvotes: 0
Reputation: 1007379
This is not strictly possible. GridView
does everything in terms of cells.
Now, you are welcome to create a set of cells that, when displayed together in a row, happen to look like a header. Presumably my MergeAdapter
can handle that, though I have certainly never tried it. It will be up to you to ensure that:
areAllItemsEnabled()
and isEnabled()
correctly, so that the header cells and the empty cells are not enabledUpvotes: 6