主程序很简单了
setContentView(R.layout.main);
看一下main
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="a checkbox" />
<CheckBox android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="checked checkbox"
android:checked="true" />
<CheckBox android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="new checkbox"
android:background="@drawable/checkbox_background" android:button="@drawable/checkbox" />
<CheckBox android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="new checked checkbox"
android:checked="true" android:background="@drawable/checkbox_background"
android:button="@drawable/checkbox" />
</LinearLayout>
前两个是默认的 一个为选择的 一个是没有选择的
后面两个是改变之后的。
从代码中可以看出来 只有android:background和android:button
drawable/checkbox_background 他是一个xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/checkbox_label_background" />
</selector>
checkbox_label_background是一个9.png图片
drawable/checkbox
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:state_focused="true"
android:drawable="@drawable/checkbox_on_background_focus_yellow" />
<item android:state_checked="false" android:state_focused="true"
android:drawable="@drawable/checkbox_off_background_focus_yellow" />
<item android:state_checked="false"
android:drawable="@drawable/checkbox_off_background" />
<item android:state_checked="true"
android:drawable="@drawable/checkbox_on_background" />
</selector>
分享到:
相关推荐
3.14 随意改变大小的文本框 3.15 文本框的自动全选 3.16 文本框滚动导航 3.17 按钮获取焦点 3.18 文本框获取焦点弹出下拉框 3.19 文本框简单的单击效果 3.20 文字的打字效果 3.21 文字滚动 3.22 文字滑动 3.23 文字...
3.14 随意改变大小的文本框 3.15 文本框的自动全选 3.16 文本框滚动导航 3.17 按钮获取焦点 3.18 文本框获取焦点弹出下拉框 3.19 文本框简单的单击效果 3.20 文字的打字效果 3.21 文字滚动 3.22 文字滑动 3.23 文字...
分别介绍了C#语言基础、Windows窗体及常用控件、Windows高级控件、控件公共属性、方法及事件、数据库开发、文件、数据流与注册表、GDI+绘图技术和C#高级编程,共包含562个C#编程中常用的属性、方法、类和各种技术,...
88 <br>0136 如何进行文本加密与解密 88 <br>0137 如何区别0、空字符串、Null、Empty和Nothing 89 <br>0138 从字符串中分离文件路径、文件名及扩展名 89 <br>0139 如何批量替换某一类字符串 89...
|--修改文件的最后修改时间 |--偏好设置(回显) |--内存优化之各种方法 |--内容提供者之短信的序列化对象读写 |--内容提供者之短信的获取与写入 |--内容提供者之联系人读写与批量操作 |--内容提供者之获取通话记录 |-...