我更改了Android 2.3.4复选框的位图,并且想要设置位图的大小来缩放它们。我改变了这样的复选框:如何更改android复选框的按钮大小?
<CheckBox
android:id="@+id/cb1"
android:button="@drawable/checkbox"
android:layout_alignParentLeft="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Sort: 1" />
与匹配的XML绘制
<?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>
我怎样才能设置一个DIP/DP值来改变复选框的位图的大小?
我不知道你的意思,你能不能更精确一点? – HardCoder 2012-04-14 21:42:06