Frame91
Frame91

Reputation: 3789

Elegant way to show details in a listview in android

I'm trying to implement the following listView:

I hope my question is easy to understand: How is it possible, to add some special information (these information are very long sometimes).

I can realise this by using ExpendableListViews with only one child element for each listelement... but I find this possibility not good.

Can someone help me?

Thank you!

Upvotes: 0

Views: 370

Answers (2)

Ahmad
Ahmad

Reputation: 72533

To do this you'll need an ExpandableListView

From the documentation:

A view that shows items in a vertically scrolling two-level list. This differs from the ListView by allowing two levels: groups which can individually be expanded to show its children. The items come from the ExpandableListAdapter associated with this view.

Upvotes: 1

logray
logray

Reputation: 2332

The easiest way to do this is to use a ExpandableListView or extend a fragment or activity using ListFragment or ListActivity.

Then use a custom ListAdapter, or CursorAdapter, or wherever you are getting your data from so you can override the default "list view" and create your own custom "list view" with the elements laid out however you want.

Upvotes: 1

Related Questions