`
hyshucom
  • 浏览: 809639 次
文章分类
社区版块
存档分类
最新评论

ListView和ListItem中的CheckBox点击冲突的问题

 
阅读更多
  1. <CheckBox
  2. android:id="@+id/cb"
  3. android:layout_width="wrap_content"
  4. android:layout_height="wrap_content"
  5. android:focusable="false"
  6. android:focusableInTouchMode="false"
  7. android:clickable="false"
  8. android:checkMark="?android:attr/listChoiceIndicatorMultiple"/>
  1. android:focusable="false"
  2. android:focusableInTouchMode="false"
  3. android:clickable="false"

这三句很重要,如果不加就会出现错误。

由于checkbox的点击事件优先级比listview的高,所以要在checkbox中添加android:focusable="false",使得checkbox初始的时候没有获取焦点。


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics