expandablelistview is not getting expanded when checkbox is added in parent xml

给你一囗甜甜゛ 提交于 2019-12-20 03:46:12

问题


I have developed the sample code of ExpandableListView in android. 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.


回答1:


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.




回答2:


In groupView layout set android:focusable="true" , android:clickable="true". For checkbox set android:focusable="false"



来源:https://stackoverflow.com/questions/20286769/expandablelistview-is-not-getting-expanded-when-checkbox-is-added-in-parent-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!