I have a ListView
:
<ListView
android:id="@+id/my_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
The layout of each row of the ListView
is:
<? Xml version="1.0"encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/my_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_algnParentLeft="true"
android:layout_centerVertical="true"
/>
<TextView
android:id="@+id/my_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/my_img"
android:textColor="@drawable/black" />
<RadioButton
android:id="@+id/my_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/my_value" />
</ RelativeLayout>
As you see above, there is a RadioButton
on each row of the list, how to implement the following two features regards to the RadioButton
:
1. Suppose there are 3 items in the list, how to make the radio button on each row perform single selection on the list ? (By default, I can select all of the radio buttons)
2. How to have each item row area clickable for the radio button selection instead of only click on radio button for selection?