列表内容
ListView中加入RadioButton 当点击ListView的item时,选中里面的RadioButton
item的布局xml
注意:android:descendantFocusability=”blocksDescendants”该属性的作用是直接覆盖子view的点击事件。不设置,子view就会获取到监听,item的监听将会失效
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="100dp"
android:background="#ffffff"
android:descendantFocusability="blocksDescendants"
>
<LinearLayout
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="1"
android:gravity="center">
<RadioButton
android:id="@+id/item_group_member_checked"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight=