Are there any built-in ways for creating Android ListView section headers? If not what is the easiest way for doing so, using XML markup as far as possible?
Asked
Active
Viewed 8,122 times
3
siva636
- 15,428
- 23
- 93
- 131
-
Do you mean you want to add a header view? : http://developer.android.com/reference/android/widget/ListView.html#addHeaderView%28android.view.View%29 – znat Dec 06 '12 at 14:23
-
I think this is for a single header. I want multiple headers in a single ListView. – siva636 Dec 06 '12 at 15:39
2 Answers
6
No. You can make your own implementation or use a third-party library. I suggest you to use this one in case you want them to stick at the top of the list:
Flávio Faria
- 6,496
- 3
- 38
- 58
1
You can add several headers using addHeaderView (View v). Your views are then handled by a HeaderViewListAdapter
znat
- 12,664
- 14
- 66
- 101
-
4It seems addHeaderView() is for adding header(s) at the top of the list, but not for section headers. – siva636 Dec 07 '12 at 06:57