0
我有一个启用CHOICE_MODE_MULTIPLE_MODAL的ListView。它工作得很好,只要在列表项XML中的RelativeLayout中只包含一个TextView,就会长时间选择列表项。多选列表视图不能在列表项中使用多个组件
但是,当我添加一个复选框的项目XML然后我无法选择列表项目与长按。 任何帮助将不胜感激。
工作表的项目XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/list_item_selector">
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/todoNoteTitle"
android:layout_alignParentTop="true"
android:textSize="18sp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:paddingTop="20dp"
android:paddingBottom="20dp"
android:paddingLeft="10dp" />
</RelativeLayout>
非工作表的项目XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/list_item_selector">
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/todoNoteTitle"
android:layout_alignParentTop="true"
android:textSize="18sp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:paddingTop="20dp"
android:paddingBottom="20dp"
android:paddingLeft="10dp" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/checkboxTodo"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:textSize="18sp"
android:paddingTop="20dp"
android:paddingBottom="20dp"
android:paddingRight="20dp"/>
</RelativeLayout>
任何线索?
不,这不是要求。复选框选中/取消选中与列表项选择无关。你可以考虑像复选框检查将使任务完成,因为列表项选择将启用删除整个列表项。 –