Android ExpandableListView使用指南
来源:互联网 发布:全国汽车保有量数据 编辑:程序博客网 时间:2024/05/23 17:55
项目有个需求,实现的要求大概如下:(图片来源于谷歌)
我搜索了好几天,如何将多个LIstview放在一起显示,甚至搜出 将两个Listview放在同一个ScrollView中的解决办法 ,但是 ScrollView 和 Listview 是官方声明是不可以一起使用的,会大大的影响性能。
终于在小伙伴的提醒下,知道还有这么一个好东西!
先推荐我在学习过程中的博客链接:
非常全面的一篇博客(英)
要使用一个 ExpandableListview , 如果按照链接网址的做法,思路是什么呢?
- 首先 我们需要两个 xml 文件
group.xml
和child.xml
分别用于表示 groip组级item,和子级item的样式 - 需要一个继承于 BaseExpandableListAdapter (我使用的是这个)的适配器
- 需要两个 对象,一个 Group,一个Child,并且Group里含有一个 List< Child >
- 需要一个 Group 列表
还有一些可能要做的操作,比如:
private void expandAndClearClick() { // 去除默认箭头 list.setGroupIndicator(null); // 展开所有group int count = listAdapter.getGroupCount(); for (int i = 0; i < count; i++){ list.expandGroup(i); } // 点击group无效(不展开,不缩回) list.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { return true; } }); }
ExpandableListview在外层套一歌swipeToRefresh,一样是可以实现下拉刷新的!
0 0
- Android ExpandableListView使用指南
- ExpandableListView Android
- android ExpandableListView
- android ExpandableListView
- android expandablelistview
- android ExpandableListView
- android ExpandableListView
- android ExpandableListView
- Android ExpandableListView
- Android ExpandableListView
- Android ExpandableListView
- Android ExpandableListView显示模板
- android ExpandableListView使用
- android-ExpandableListView(2)
- Android ExpandableListView的使用
- Android ExpandableListView的使用
- Android控件之ExpandableListView
- Android 自定义 ExpandableListView
- CodeForces 703D Mishka and Interesting sum
- 操作系统进程与线程
- 利用搜索法求百万以内的素数
- WIN7(64bit)编译运行gh0st3.6
- Quartz使用技巧总结
- Android ExpandableListView使用指南
- 整理笔记---Hibernate二级缓存
- 怎么判断一个点是否在多边形区域内
- HDU 5802 Windows 10(dfs)
- 充电website note
- ibatis 使用学习入门
- VC2010 MFC中实现printf调试功能,即MFC程序利用控制台输出调试信息。
- Struts2访问request、session、application对象
- OC反射机制