android 自定义radiobutton的样式 实现自己想要的样子

效果图:

android 自定义radiobutton的样式 实现自己想要的样子_第1张图片

 对radiobutton的样式自定义无非就是style,在style里面有background来设置radiobutton的背景 button来设置radiobutton的小框框,当为null的时候,就是不要框框了

自定义的第一种style:

 

mycustome_radio_selctor xml的代码:




    
    
    
    
    
    



第二种自定义样式style:


rb_nobtn_selector xml:




    
    



只需要关注state_checked的状态就行了

这样效果就实现了.图片最好用.9图,gravity设置center就好



你可能感兴趣的:(android)