需求: 实现一个ListView布局,具体代码中继承并重写了BaseAdapter作为ListView的Item,
在点击每一个Item的时候,CheckBox会自动勾选/取消勾选,而在UI上屏蔽掉CheckBox的勾选功能,设置下面三个属性是关键
android:descendantFocusability="blocksDescendants"
android:clickable="false"
android:focusable="false"
下面的XML文件是ListView中Item的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:minHeight="@di