android 如何清空radiobutton绿点

2025-05-10 08:36:17
推荐回答(2个)
回答1:

一、定义一个style,然后设置一个item属性为@null


二、RadioButton引用下就OK
style="@style/style"
/>

回答2:

RadioButton,利用xml修改android:background="@drawable/button_drawable",其中button_drawable为自己定义的.xml文件(res/drawable文件下),但是不成功,到网上查找,也没有正确的说法,我就开始自己尝试,最后做好了。
其实方法很简单,同样在res/drawable新建radiobutton.xml如下
01
02 03 android:state_enabled="true"
04 android:state_checked="true"
05 android:drawable="@drawable/check" />
06 07 android:state_enabled="true"
08 android:state_checked="false"
09 android:drawable="@drawable/checknull" />
10

1 check和checknull分别为选中和位选中的图片。
1 然后在你的布局文件中,RadioButton 布局
1 设置android:button = "@drawable/radiobutton",就可以了!
如果有用,请采纳哦,谢谢!