ListView onClickListener() does not work after adding RadioButton

后端 未结 2 854
耶瑟儿~
耶瑟儿~ 2020-12-31 08:10

I have a ListView (my_list.xml):

 

        
相关标签:
2条回答
  • 2020-12-31 08:58

    add this code to your RadioButton XML code:

    android:focusable="false"
    android:focusableInTouchMode="false"
    

    Another keyword to solve this problem is TouchDelegate.

    Edit:

    https://stackoverflow.com/a/5528945/1285331

    0 讨论(0)
  • 2020-12-31 08:59

    Set the following properties to your RadioButton:

    android:focusable="false"
    android:focusableInTouchMode="false"
    

    and in your OnItemClickListener, you need to set the radio button's checked flag by code.


    Set you ListView as below:

    <ListView
      android:id="@+id/my_list"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" />
    
    0 讨论(0)
提交回复
热议问题