M
M
mitaichik2015-05-24 14:24:06
Android
mitaichik, 2015-05-24 14:24:06

How to make a complex ListView in android?

Hello. We need to make a complex ListView, namely: it has several sections separated by a header, the item of each section has a different layout (but the same for the entire section). How to make such a listView?
In fact - you can use ExpandableListView, but is it a good option? Perhaps there is some lib that does it without it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
swba, 2015-05-24
@mitaichik

You need a special sheet adapter. You can act like a true programmer - write the adapter yourself. This is not difficult at all - you need to inherit from BaseAdapter and implement, in addition to the standard ones, two methods related to the types of sheet elements: getItemViewType and getViewTypeCount. You can have any number of element types. Accordingly, in the main getView method, you can choose the layout that matches the type of the requested element.

B
belozerow, 2015-05-24
@belozerow

There is such a library
https://github.com/commonsguy/cwac-merge

V
vikarti, 2015-08-01
@vikarti

read the chapter "Advanced ListViews" from https://commonsware.com/Android/ - there will be a detailed description of what swba writes about

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question