Reputation: 1823
I want to make a ListView like the one below. The ListItems will be grouped into sections and different sections have different item count. how do i get started??
N.B. I want the section headers on the side. i may also mention the items are queried from the database and sections are for now calculated based on a column in the table.
Upvotes: 2
Views: 2117
Reputation: 4132
I think i have found something exactly what you need. You need to implement separate adapters for sectionItem and EntryItem in this particular example which i am showing you.
Presuming that you know how to handle adapters and ListItems (customised with your own item.xml
), this is a full fledged tutorial for how to make sections and entries.(Solution #2)
In the tutorial,the code to xml layout is also given but you may make your own custom layout for the section and entryitems.Its pretty easy and straightforward.
So that it will come off like this:
Upvotes: 1
Reputation: 2318
Use expandable listViews, here is example http://android-adda.blogspot.in/2011/06/custom-expandable-listview.html and for more info refer http://developer.android.com/reference/android/widget/ExpandableListView.html
Upvotes: 0