我的布局是item控件包含一个CheckBox控件,两者都有点击事件,listview点击事件失效,item子控件checkbox点击事件可以使用。
解决办法:
1、在Item的xml文件根元素中加入属性:
android:descendantFocusability="blocksDescendants"
2、在冲突的子控件中加入属性:
android:focusable="false"
android:clickable="true"
我的布局是item控件包含一个CheckBox控件,两者都有点击事件,listview点击事件失效,item子控件checkbox点击事件可以使用。
解决办法:
1、在Item的xml文件根元素中加入属性:
android:descendantFocusability="blocksDescendants"
2、在冲突的子控件中加入属性:
android:focusable="false"
android:clickable="true"