Android: How to change CheckBox size?
Solution 1:
Starting with API Level 11 there is another approach exists:
<CheckBox
...
android:scaleX="0.70"
android:scaleY="0.70"
/>
Solution 2:
Here is a better solution which does not clip and/or blur the drawable, but only works if the checkbox doesn't have text itself (but you can still have text, it's just more complicated, see at the end).
<CheckBox
android:id="@+id/item_switch"
android:layout_width="160dp" <!-- This is the size you want -->
android:layout_height="160dp"
android:button="@null"
android:background="?android:attr/listChoiceIndicatorMultiple"/>
The result:
What the previous solution with scaleX
and scaleY
looked like:
You can have a text checkbox by adding a TextView
beside it and adding a click listener on the parent layout, then triggering the checkbox programmatically.