Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/182.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何折叠Android ExpandableList项中的所有ChildView组?_Android_Expandablelistview - Fatal编程技术网

如何折叠Android ExpandableList项中的所有ChildView组?

如何折叠Android ExpandableList项中的所有ChildView组?,android,expandablelistview,Android,Expandablelistview,如何在可展开列表中折叠所有ChildView组。现在我有两个按钮来控制“全部展开”和“全部折叠”活动。可展开按钮是正常的,它是工作,但我不知道如何折叠所有儿童视图组。我该怎么做 谢谢 **expandableListView.expandGroup(position, true); = OK<Br> expandableListView.foldGroup(position) = ? or ?** **expandableListView.expandGroup(位置,true)

如何在
可展开列表中折叠所有ChildView组
。现在我有两个按钮来控制“全部展开”和“全部折叠”活动。可展开按钮是正常的,它是工作,但我不知道如何折叠所有儿童视图组。我该怎么做

谢谢

**expandableListView.expandGroup(position, true); = OK<Br>

expandableListView.foldGroup(position) = ? or ?**
**expandableListView.expandGroup(位置,true);=好的
expandableListView.foldGroup(位置)=?还是**
试试这个

int count = (new ExpAdapter(this)).getGroupCount();
        b.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                for (int i = 0; i < count; i++)
                {
                    expList.collapseGroup(i);
                }

            }
        });
int count=(新的ExpAdapter(this)).getGroupCount();
b、 setOnClickListener(新视图。OnClickListener(){
@凌驾
公共void onClick(视图v){
for(int i=0;i
我发现折叠的解决方案是调用方法collapseGroup(位置)。谢谢你。