扩展列表视图设计 [英] expandable listview design

查看:144
本文介绍了扩展列表视图设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表视图present设计来显示程序列表。但是,如果该程序是一个系列,程序必须被分成一个事务所的实体,在系列点击时的方案应根据它来填充。
截至目前我已经有一系列的ID,节目名称等,这些具​​有相同的系列ID的程序应归类为一个系列的详情,一个ArrayList,其余部分应显示为正常的项目。当这一系列点击,所有那些有点击的系列节目seriesID,应被点击项目下图所示。
任何深入了解使用扩展列表视图的同样是非常有用的:)

I have a present design in listview to display a list of programs. But if the program is a series, the programs must be grouped into a sigle entity and when clicked on the series the programs should be populated under it. As of now I have an arraylist which has details of series ID, program name etc. The programs which have same series ID should be grouped as a single series, rest should be shown as normal items. When clicked on this series, all those programs which have the seriesID of the clicked series, should be shown under the clicked item. Any insight into using expandable listview for the same is very useful:)

推荐答案

要使用扩展列表视图需要创建适配器类要显示扩展列表视图中创建一个类BaseExpandableListAdapter

To use expandable List view need to create Adapter class as want to display expandable list view create a class BaseExpandableListAdapter

1.采用这个你必须使用重载函数
1.getchildview
2.getGroupview

1.with in this you have to use overridden functions 1.getchildview 2.getGroupview

1.getChildCount和getGroupcount回报父母与子女的长度

1.getChildCount and getGroupcount return the length of parent and child

请参阅您的程序和系列
创建两个数组列表项目和一个系列
出一个哈希地图,找到特定的程序是否有串联或不

See you have programs and series create two arraylist programs and one series one hash map to find whether particular program is having series or not

然后在基地扩展列表适配器

then with in Base expandable list adapter

1.采用在getGroupCount
返回程序ArrayList的长度
2.具有在getchildernCount的长度
返回程序的长度[位置]。长度(该程序是否使用一系列的HashMap)

1.with in getGroupCount return the length of programs arraylist 2.with in the length of getchildernCount return the length of program[position].length (if that program has series use hashmap)

这篇关于扩展列表视图设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆