自定义RadioButton
来源:互联网 发布:计算天数的软件 编辑:程序博客网 时间:2024/06/03 17:27
1.首先,在drawable目录下创建一个btn_selector.xml文件:
内容实例:
<?xml version=
"1.0"
encoding=
"utf-8"
?>
<selector>
//定义不同状态下的图片信息
<item android:state_checked=
"true"
android:state_window_focused=
"false"
android:drawable=
"@drawable/btn_sort_check_on"
/>
<item android:state_checked=
"false"
android:state_window_focused=
"false"
android:drawable=
"@drawable/btn_sort_check_off"
/>
<item android:state_checked=
"false"
android:drawable=
"@drawable/btn_sort_check_off"
/>
<item android:state_checked=
"true"
android:drawable=
"@drawable/btn_sort_check_on"
/>
</selector>
然后,
2. //
将RadioButton的原来的背景图屏蔽。
android:button=
"@null"
3.
android:drawableBottom使用自己写的选择器(Bottom表示图片位置)。
android:drawableBottom=
"@drawable/web_cam_radion_button_selector"
这样可以了。
0 0
- RadioButton与自定义RadioButton
- 自定义RadioButton
- 自定义Radiobutton
- 自定义radiobutton
- 自定义RadioButton
- RadioButton 自定义
- 自定义RadioButton
- 自定义RadioButton
- 自定义RadioButton
- RadioButton - android 自定义RadioButton样式
- 自定义RadioButton样式1
- 自定义RadioButton样式
- RadioButton自定义样式
- 自定义 RadioButton 图片
- android 自定义RadioButton样式
- Android RadioButton的自定义
- 自定义RadioButton样式2
- 自定义RadioButton样式
- Android UI之ListView+CheckBox(避免抢占焦点)
- POJ - 1458 Common Subsequence(最长公共子序列)
- 浅析 PHP 官方自动化测试方法
- POJ - 2533 Longest Ordered Subsequence(最长上升子序列)
- javascript图片随滚动条置顶
- 自定义RadioButton
- Scanner vs. StringTokenizer vs. String.Split
- sourceinsight 无法搜索类似 .s .S .kconfig文件的解决办法
- 【软件工程作业01】
- https 基础
- hdu5249KPI【treap】
- 【Odoo】XML_RPC访问Odoo数据库
- Java实现UML中的五种关系
- HttpUnit Ajax处理