Android: How to change CheckBox size?


Question

I would like to make CheckBox a bit smaller/bigger, how can I do this?

1
85
1/27/2010 11:45:15 PM

Accepted Answer

You just need to set the related drawables and set them in the checkbox:

<CheckBox 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:text="new checkbox" 
    android:background="@drawable/my_checkbox_background"
    android:button="@drawable/my_checkbox" />

The trick is on how to set the drawables. Here's a good tutorial about this.

55
1/28/2010 7:36:53 AM

Starting with API Level 11 there is another approach exists:

<CheckBox
    ...
    android:scaleX="0.70"
    android:scaleY="0.70"
/>

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon