Skip to content Skip to sidebar Skip to footer

Xml For Checked List Item In A Listview

I've been searching all over for an example of the XML needed to setup a ListView to use a checkbox. While I've been able to find the Java code needed, the XML for the list items

Solution 1:

Found it!

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

Solution 2:

You can always create a layout of your own and inflate the same. But, for this you need to write a customized code for Adapter.

Here is one good example to start.

Post a Comment for "Xml For Checked List Item In A Listview"