自定義樣式 在values中創建styles.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyCheckBox" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawableselector</item>
<item name="android:paddingLeft">20.0dip</item>
<item name="android:maxHeight">10.0dip</item>
</style>
</resources>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MyCheckBox"
/>
妳的采納是我前進的動力,還有不懂的地方,請妳繼續“追問”!
如妳還有別的問題,可另外向我求助;答題不易,互相理解,互相幫助!