Question

I can add an image to checkedtxt view with the following xml:

<LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
    <ImageView android:layout_width="wrap_content" android:src="@drawable/icon" android:layout_height="wrap_content" android:id="@+id/fIconImg" android:layout_marginRight="5dp"></ImageView>
    <TextView android:text="TextView" android:layout_height="wrap_content" android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/fTitleTxt" android:textColor="@color/black"></TextView>

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/favoriteChkTxtVw"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:paddingLeft="6dip"
android:paddingRight="6dip"/>

</LinearLayout>

However when I do this, the checkboxes in each row of the listview it is in does not click. When the row layout consists of only a checktextview then the checkboxes check no problem.

Does anyone know how I can have a checkedtxtview in my row with the ability to check and uncheck while also maintaining the image and text view?

Was it helpful?

Solution

Where is your checkbox image?

try taking the "xmlns:android="http://schemas.android.com/apk/res/android"" off the Checkedtextview, and have it only for the first view item.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top