您的位置:首页 > 其它

ListView中含有CheckBox或者Button等控件,导致item点击无效的原因。

2015-04-21 15:33 525 查看
ListView 的item中存在,一些控件(如:Button、CheckBox、RadioButton等)会抢占ListView 的 item 点击时的焦点,导致点击无效,不会执行OnItemClickListener(){}中的代码。

         解决办法:

 

            Button中加一个属性 

         android:focusable="false"

            CheckBox中加上下面属性 

             android:enabled="false"

        android:focusable="false"

        android:clickable="false"

        android:focusableInTouchMode="false"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  listview checkbox
相关文章推荐