您的位置:首页 > 其它

原 ExpandableListView的用法

2015-09-30 20:10 405 查看


原 ExpandableListView的用法

发表于2年前(2014-03-04 15:09) 阅读(8340) | 评论(25人收藏此文章, 我要收藏

赞3

10月17日南京OSC源创会第40期开始报名,精美礼品等你到现场拿






android ExpandableListView BaseExpandableListAdapter

ExpandableListView组件是android中一个比较常用的组件,当点击一个父item的时候可以将它的子item显示出来,像手机QQ中的好友列表就是实现的类型效果。使用ExpandableListView组件的关键就是设置它的adapter,这个adapter必须继承BaseExpandbaleListAdapter类,所以实现运用ExpandableListView的核心就是学会继承这个BaseExpanableListAdapter类。

下面是一个小demo:

activvity_main.xml:

?
layout_parent.xml:(父item运用的样式)

?
layout_children.xml:(子item运用的样式)

?
MainActivity.java:

?
最后的实现结果:







内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: