码迷,mamicode.com
首页 > 其他好文 > 详细

radioButton drawable selector

时间:2018-01-05 19:08:35      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:enable   sele   sel   focus   .com   span   小圆圈   and   null   

1.实现radioButton drawable selector更改图片,在drawable文件夹下,新建selector文件,

<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_enabled="true" android:state_focused="true" android:state_pressed="false"  android:drawable="@drawable/wo_unfocus" />
  <item android:state_enabled="true" android:state_pressed="true" android:drawable="@drawable/wo_focus" />
  <item android:state_enabled="true" android:state_checked="true" android:drawable="@drawable/wo_focus" />
  <item android:drawable="@drawable/wo_unfocus"/>
</selector>

2.实现radiobutton text 的颜色更改,在res下,新建color文件夹,然后新建selector

<?xml version="1.0" encoding="utf-8"?>
    <selector
        xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:state_checked="false" android:color="@color/fontSomberbess"/>
        <item android:state_checked="true" android:color="@color/fontRoseo"/>
    </selector>

3.radiobutton 去掉小圆圈

 android:button="@null"

 

radioButton drawable selector

标签:enable   sele   sel   focus   .com   span   小圆圈   and   null   

原文地址:https://www.cnblogs.com/hechangshou/p/8206213.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!