最好的本地组件,以用于Android的单独列表视图 [英] best native component to use for separate listview in android
问题描述
您好我需要有哪些按日期分离这机组件我应该在Android中使用的列表视图?邹能帮助我与一些链接mazbe,如何做它。我有一个列表活动$ C $光盘,工作fine.thanks
或者一些下拉框,如果是更好,我的意思是sthink这样的:
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 working fine.thanks or maybe some dropdown box if is better i mean sthink like that:
推荐答案
这是 ExpandableListView
自定义组和子布局和残疾人塌陷是最简单的解决方案,为您服务。
An ExpandableListView
with custom group and child layout and disabled collapsing would be the simplest solution for you.
组的列表将是日期,孩子的列表将是childLists(每个组列表)。
The list of groups would be the dates, the list of children would be the childLists (for each group a list).
但随着 BaseExpandableListAdapter
和分级数据结构,将会变得容易。
还有你需要用的姓名(或日期)一个天
类和儿童名单
实例,其中儿童
有一个标题
和详细信息
成员。
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}
这篇关于最好的本地组件,以用于Android的单独列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!