Android为CheckBox设置Style
来源:互联网 发布:易知投资有限责任公司 编辑:程序博客网 时间:2024/06/05 07:26
MainActivity如下:
package cc.testcheckboxstyle;import android.os.Bundle;import android.app.Activity;/** * Demo描述: * 为CheckBox设置Style */public class MainActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);}}
main.xml如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="测试CheckBox的Style" android:layout_centerHorizontal="true" android:layout_marginTop="20dip" /> <CheckBox android:id="@+id/checkBox" android:layout_width="100dip" android:layout_height="100dip" android:layout_centerInParent="true" style="@style/CheckBoxStyle" /></RelativeLayout>
styles.xml如下:
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="AppBaseTheme" parent="android:Theme.Light"> </style> <style name="AppTheme" parent="AppBaseTheme"> </style> <style name="CheckBoxStyle" parent="@android:style/Widget.CompoundButton.CheckBox"> <item name="android:button">@drawable/checkbox_background</item> </style> </resources>
checkbox_background.xml如下:
<?xml version="1.0" encoding="UTF-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:drawable="@drawable/on"/> <item android:state_checked="false" android:drawable="@drawable/off"/></selector>
- Android为CheckBox设置Style
- Android设置Activity背景为透明style
- Android设置Activity背景为透明style
- Android设置Activity背景为透明style
- Android设置Activity背景为透明style
- Android设置checkbox为选中状态
- android checkbox,radiobox style自定义
- Android设置Activity背景为透明style发生的错误
- 设置checkbox为只读效果
- android Theme 设置为Android:style/Theme.Light.NoTitleBar.Fullscreen 程序秒退
- Android主题设置为@android:style/Theme.Dialog报错解决办法
- android style设置控件样式
- android 样式style的设置
- android 设置全局控件style
- android dialog style属性设置
- KDE4下设置gtk style为oxygen
- Android 在Java代码中设置style属性,以ProgressBar为例
- Android做一个透明的Activity,设置Activity背景为透明style
- 调查问卷录入spss
- js异步加载
- 关于分割平面问题的总结
- 动态改变ActionBar菜单项
- 【LeetCode】 Best Time to Buy and Sell Stock III
- Android为CheckBox设置Style
- Perl 使用管道实现进程间的通信
- EPP 修改字体大小
- A、B两个整数集合,设计一个算法求他们的交集,尽可能的高效
- linux C的学习笔记
- Web服务请求异步化
- 指向Class Member的指针
- 线程同步之信号量("旗帜"就是方向,"旗帜"就是形象, "旗帜"就是指挥棒)
- pdf online document view