您的位置:首页 > 移动开发 > Android开发

Android ListView和item中的CheckBox点击冲突的问题解决

2016-09-27 17:01 791 查看
由于checkbox的点击事件优先级比listview的高,所以要在checkbox中添加android:focusable=”false”,使得checkbox初始的时候没有获取焦点。

android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"


添加这三句话错误解决

<CheckBox
android:id="@+id/cb_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:checked="true"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false" />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android checkbox listview
相关文章推荐