मैं एक कार्य सूची है, और list_item.xml में प्रत्येक सूची आइटम को परिभाषित किया है इस प्रकार हैचेक बॉक्स बनाना ListView आइटम गैर क्लिक करने योग्य
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/list_overdue_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/overdue"
android:visibility="invisible" />
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp" >
<CheckBox
android:id="@+id/list_done"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingRight="5dp"
android:gravity="center_vertical" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/list_done"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/list_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="10dp"
android:textColor="@color/white"
android:textSize="18dp"
android:textStyle="bold" />
<ImageView
android:id="@+id/list_note_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_toRightOf="@+id/list_title"
android:background="@drawable/note" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/list_prio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17dp"
android:textStyle="bold" />
<TextView
android:id="@+id/list_due_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17dp"
android:visibility="gone" />
<TextView
android:id="@+id/list_calendar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17dp"
android:visibility="gone" />
</LinearLayout>
<TextView
android:id="@+id/list_note"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="15dp" />
</LinearLayout>
</RelativeLayout>
जिसके परिणामस्वरूप सूची आइटम इस तरह दिखता है:
समस्या यह है कि xml में चेकबॉक्स के साथ, मैं किसी भी सूची आइटम का चयन करने में असमर्थ हूं। सूची आइटम पर क्लिक करने पर ListItem पर क्लिक करना चाहिए क्लिक करें हालांकि यह कुछ भी नहीं करता है। मैं जोड़ देते हैं तो
एंड्रॉयड: दृश्यता = "चला गया"
चेकबॉक्स के, मैं आइटम क्लिक करने के रूप में मैं खुश कर रहा हूँ। चेकबॉक्स इस क्षमता को बर्बाद क्यों कर रहा है?