android 自定义 radiobutton 文字颜色随选中状态而改变
来源:互联网 发布:mcst指标源码 编辑:程序博客网 时间:2024/05/22 09:43
先看效果
主要是写一个 color selector
在res/建一个文件夹取名color
res/color/color_radiobutton.xml
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:color="@color/color_text_selected"/> <!-- not selected --> <item android:color="@color/color_text_normal"/></selector>
程序中就可以直接使用了
//layout/main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <RadioGroup android:id="@+id/radiogroup_personal_condition" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <RadioButton android:id="@+id/radiobutton_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/selector_radio" android:button="@null" android:checked="true" android:gravity="center" android:text="目录" android:textColor="@color/color_radiobutton" android:textSize="@dimen/font_size" android:textStyle="bold" /> <RadioButton android:id="@+id/radiobutton_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/selector_radio" android:button="@null" android:gravity="center" android:text="书签" android:textColor="@color/color_radiobutton" android:textSize="@dimen/font_size" android:textStyle="bold" /> </RadioGroup></LinearLayout>
- android 自定义 radiobutton 文字颜色随选中状态而改变
- android 自定义 radiobutton 文字颜色随选中状态而改变
- android 自定义 radiobutton 文字颜色随选中状态而改变
- android 自定义 radiobutton 文字颜色随选中状态而改变
- android 自定义 radiobutton 文字颜色随选中状态而改变
- android 自定义 radiobutton 文字颜色随选中状态而改变
- android 自定义 radiobutton 文字颜色随选中状态而改变
- android 自定义 radiobutton 文字颜色随选中状态而改变
- Android Radiobutton 文字颜色随选中状态而改变
- Android的RadioButton随着选中状态的改变字体颜色也改变
- radio选中状态对应文字改变颜色
- radiobutton 文字颜色改变
- android listview 选中部分 文字颜色改变
- android radiobutton选中字体颜色改变的方法
- android radioButton 选中后改变字体颜色样式
- 文字根据状态改变颜色 android:textColor
- 字体颜色随选中状态改变
- RadioGroup+RadioButton嵌套其他布局实现多行单选布局、自定义RadioButton选中和非选中样式、文字颜色
- Oracle 的 to_date 函数详解 日期总结
- 链表原地置反
- Win32DLL源码换编译器
- 使用Cisco VPN 报错原因
- android 平滑切换屏幕的几种方法总结
- android 自定义 radiobutton 文字颜色随选中状态而改变
- 开放式有关软件自动化测试和问题
- 对List进行排序的方法
- 隐马尔科夫模型HMM自学(1)
- fastdb一个表支持注册到多个库
- 数字图像处理的研究方法
- MACRO do-while(0) 的几个用法
- Cannot use typeid with -fno-rtti错误的解决
- 那些年,我还在学习Ajax 学习笔记