本文介绍了当在父XML中添加复选框时,展开式列表视图不会展开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已开发。数据正在适配器中填充,并正确显示在 ExpandableListView 中。但是我面对一个严重的问题,即在点击 Groupview 后不会扩展子视图。



问题是当我添加复选框到(父xml) c $ c> Groupview 。但是,如果从一切正常。



类似问题已发布在StackOverflow,但似乎没有什么工作。 >

解决方案

如果您将 focusable code> list ,则列表项不再响应 / p>

尝试将 CheckBox android:focusable 属性设置为 false 。


I have developed the sample code of ExpandableListView in . Data is being populated in Adapter and displaying in the ExpandableListView properly. but i am facing one severe issue of not expanding child view after tapping on Groupview.

The problem is when i add check box to the xml(parent xml) that is inflated in getgroupView() method child view does not get expanded after tapping Groupview.But, if checkbox is removed from the xml all works well.

Similar question has been posted in StackOverflow, but nothing seems to work.

解决方案

If you place an item that is focusable in a list, then the list items no longer respond to clicks

Try to set the CheckBox android:focusable attribute to false.

这篇关于当在父XML中添加复选框时,展开式列表视图不会展开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 19:36