best native component to use for separate listview in android
Hi I need to have a list view which is separated by date which native component i should use in android?can zou help me mazbe with some links, how to do it.I have an list activity coded, and wor开发者_JAVA技巧king fine.thanks or maybe some dropdown box if is better i mean sthink like that:
You could use a normal ListView, you'd just have to put logic in your adapters getView() method that inflates a date View at the appropriate times.
An ExpandableListView
with custom group and child layout and disabled collapsing would be the simplest solution for you.
The list of groups would be the dates, the list of children would be the childLists (for each group a list).
But with a BaseExpandableListAdapter
and a hierarchical data structure it would be even easier.
There you'd need a Day
class with name (or date), and a list of Child
instances, where Child
has a title
and a details
member.
Child {title: String, details: String}
Day {date: Date, List<Child> children}
精彩评论