0
我試圖通過使用png文件更改複選框中的按鈕,但圖像太大並且使按鈕太大。如何在複選框中更改按鈕的大小
我想將Button的大小更改爲20dp。 然後我在CheckBox中設置了layout_width和layout_height,但它沒有解決問題。
你能教我如何改變尺寸嗎?
<CheckBox
android:layout_width="20dp"
android:layout_height="20dp"
android:text="New CheckBox"
android:layout_margin="5dp"
android:button="@drawable/my_check_box"
android:layout_weight="1" />
my_check_box.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false"
android:drawable="@drawable/checkbox_normal" />
<item android:state_checked="true"
android:drawable="@drawable/checkbox_selected" />
</selector>
只是擡起頭來,不要按鈕像圖像一樣縮放。 – zgc7009