views:

57

answers:

2

Hi, Can anyone tell me how to reduce the width and height of CheckBox in order to display very small CheckBox in Android ?

Thanks In Advance,

+1  A: 

setWidth(int) and setHeight(int) since CheckBox extends CompoundButton which extends Button

Try referring to this tutorial

Alernatively try changing it via the XML:

<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" />
BeRecursive
I created CheckBox through code and used setWidth() and setHeight() methods,but still the width and Height is not changed. Any other solution for this?
Android_programmer_camera
I updated my answer with a couple of other methods
BeRecursive
+1  A: 

Simply use setWidth(w) and setHeight(h) functions as you would for a normal Button.

kiki