Sakibul Alam
Sakibul Alam

Reputation: 1823

Android Custom ListView with sections

enter image description here 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

Answers (3)

Nezam
Nezam

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:

Custom ListView

Upvotes: 1

Tomer Mor
Tomer Mor

Reputation: 8028

You should use ExpandableListView

here also some examples:

Link1 Link2

Upvotes: 0

Related Questions