Android:解决ExpandableListView中添加button后item项点击事件问题

来源:互联网 发布:首都经济贸易大学 知乎 编辑:程序博客网 时间:2024/05/18 00:03

在ExpandableListView中添加button后item项不能点击,获取不到点击事件。

原因:button按钮抢占了ExpandableListView的焦点

解决方法:为button按钮添加android:focusable="false"属性,关闭button获取焦点,ExpandableListView中的项目即可点击。



0 0