Reputation: 19378
I'm using a list with choice mode set to ListView.CHOICE_MODE_MULTIPLE. Can I use my own layout instead of simple_list_item_multiple_choice.xml? Which standard views has it to include?
Upvotes: 1
Views: 1287
Reputation: 4982
Can I use my own layout instead of simple_list_item_multiple_choice.xml?
Yes, you can use your own layout. This layout is used to fill rows of ListView
.
Which standard views has it to include?
You can use any layout, you want. e.g. Following is example of one of such layout which I used in one of my application.
<?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="23dip"
android:orientation="horizontal">
<ImageView android:id="@+id/icon1"
android:layout_width="22px" android:paddingLeft="2px"
android:paddingRight="2px"
android:layout_height="wrap_content" android:layout_gravity="center_vertical"
android:src="@drawable/icon1" />
<ImageView android:id="@+id/icon2" android:layout_width="22px"
android:paddingLeft="2px" android:paddingRight="2px"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:src="@drawable/icon2" />
<TextView android:id="@+id/label" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:padding="10dp"
android:textSize="13sp" android:text="default" android:textColor="#000000"
android:layout_gravity="center_vertical" />
</LinearLayout>
If you need to use check boxes then you can use CheckedTextView
as used in simple_list_item_multiple_choice.xml
Hope this helps !!
Upvotes: 2