ListView的setOnItemClickListener事件不响应

来源:互联网 发布:三维设计与渲染软件 编辑:程序博客网 时间:2024/05/16 05:55

原因:

当ListView的Item中包含CheckBox或Button等时,不会响应setOnItemClickListener事件

解决方法:

在Item中的子View(CheckBox或Button)的focusable设置为false即可

<CheckBox        android:id="@+id/checkBox1"        android:layout_width="wrap_content"        android:layout_height="48dp"        android:text="CheckBox"         android:focusable="false"/>

0 0