Reputation: 9138
In Android I would like to have a ListView control that lists various categories of data. I would like a header/special row for each category.
I would also like it so the header row gets fixed as the first row while scrolling through that category. When scrolling reaches the next category the new header gets fixed and the previous one just scrolls off the screen.
A quick example is shown below. Header 1 is fixed until we reach Header 2 which then takes the place of Header 1 and so on.
I'm having trouble finding a solution for this as i'm not exactly sure what to call it.. any ideas on a solution would be greatly appreciated. Thanks.
----------------------------
Header 1
----------------------------
H1-Item
H1-Item
H1-Item
H1-Item
H1-Item
H1-Item
----------------------------
Header 2
----------------------------
H2-Item
H2-Item
H2-Item
H2-Item
----------------------------
Header 3
----------------------------
H3-Item
H3-Item
Upvotes: 1
Views: 1814
Reputation: 9740
You might want to take a look at the android-section-list project, which seems like it's exactly what you want to achieve here.
Upvotes: 3