自定义RadioButton样式
2017-03-04 22:12
176 查看
Android如何自定义RadioButton的样式
1.在drawable文件夹下定义样式
在styles里面引用自定义样式
在xml中引用
这样RadioButton就可以达到你想要的效果了。
技术共享群:195109527
1.在drawable文件夹下定义样式
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@mipmap/reason_radio_btn_img_sel" android:state_checked="true" android:state_enabled="true"></item> <item android:drawable="@mipmap/reason_readio_btn_nor" android:state_checked="false" android:state_enabled="true"></item> </selector>
在styles里面引用自定义样式
<style name="RadioButtonStyles"> <item name="android:button">@drawable/reason_radiobtn_style</item> </style>
在xml中引用
<RadioButton android:id="@+id/item_reason_radio_btn" style="@style/RadioButtonStyles" android:layout_width="@dimen/dimen_22dp" android:layout_height="@dimen/dimen_22dp" android:layout_alignParentRight="true" android:layout_centerVertical="true"/>
这样RadioButton就可以达到你想要的效果了。
技术共享群:195109527
相关文章推荐
- Android:自定义PopupMenu的样式(显示图标/设置RadioButton图标)
- 自定义RadioButton样式2
- Android 自定义RadioButton的样式
- 自定义RadioButton样式并去除默认样式位置【Android】
- Android 常用控件自定义样式RadioButton、CheckBox、ProgressBar、
- RadioButton自定义样式 之一 换图片
- 自定义RadioButton样式
- 自定义RadioButton样式2
- android 自定义RadioButton样式
- RadioGroup以及RadioButton自定义样式的使用
- RadioButton和CheckBox自定义按钮图片的样式
- RadioButton自定义样式
- android 自定义radiobutton的样式 实现自己想要的样子
- Android RadioButton自定义背景色圆角样式的方法
- android 自定义RadioButton样式
- Android 自定义RadioButton的样式
- 纯代码自定义radiobutton样式
- androidRadioButton 自定义样式
- Android 自定义RadioButton样式
- android 自定义RadioButton样式