检查所有复选框ExpandableListView(Android版) [英] Check all checkbox in ExpandableListView (Android)
问题描述
我使用 ExpandableListView
。在这两个组和儿童,还有复选框。如何做到以下几点要求?
I am using ExpandableListView
. In both group and child, there are checkboxes. How to do the following requirement?
当用户检查组的复选框,检查其子女的所有框。
When user check the checkbox of group, check all the box of its child.
我想我需要覆盖 BaseExpandableListAdapter
,
但我不知道应该怎样填写。谢谢你。
I think I need to overwrite the BaseExpandableListAdapter
,
but I don't know what should be filled in. Thank You.
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent)
{
CheckBox cb = (CheckBox)v.findViewById(R.id.checkBox1);
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked)
{
//Fill in what?
}
});
}
有一个类似的问题,但我不明白它的解决方案:
<一href=\"http://stackoverflow.com/questions/6924977/how-to-get-all-childs-view-in-group-with-expandablelistview\">How让所有的孩子的组查看与ExpandableListView
There is a similar question, but I don't understand its solution: How to get all childs view in group with ExpandableListView
推荐答案
下面是一个链接: HTTP://prativas.word$p$pss.com/category/android/expandable-list-view-in-android/
包含您所需要的一切。刚刚经过code和尝试。
Here's a link:http://prativas.wordpress.com/category/android/expandable-list-view-in-android/ that contains everything that you need. Just go through the code and try it.
这篇关于检查所有复选框ExpandableListView(Android版)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!