标签:style
.xml里面
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="29dp"
android:layout_height="29dp"
android:layout_alignBaseline="@+id/textView1"
android:layout_alignBottom="@+id/textView1"
android:layout_alignParentRight="true"
style="@style/CustomCheckboxTheme"
android:layout_marginRight="10dp" />
style 里面
<style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/checbox_style</item>
</style>
drawable上:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/check" android:state_checked="true"/>
<item android:drawable="@drawable/check_all_pressed" android:state_checked="false"/>
<item android:drawable="@drawable/check_all_pressed"/>
</selector>
本文出自 “android开发” 博客,请务必保留此出处http://9238253.blog.51cto.com/9228253/1536175
标签:style
原文地址:http://9238253.blog.51cto.com/9228253/1536175