listview setOnItemClickListener无效

原因:条目中含有CheckBox控制,将条目的焦点抢走了
解决: android:focusable=“false”

 <CheckBox
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginLeft="10dp"
                    android:focusable="false"
                    android:buttonTint="@color/blue" />

猜你喜欢

转载自blog.csdn.net/xiyangyang8110/article/details/124116548