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,
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,
Simply use setWidth(w) and setHeight(h) functions as you would for a normal Button.
setWidth(int)
andsetHeight(int)
sinceCheckBox
extendsCompoundButton
which extendsButton
Try referring to this tutorial
Alernatively try changing it via the XML:
UPDATE: this only works from API 17 onwards...
As per my answer on this question: - how can we reduce the size of checkbox please give me an idea
CheckBox
derives its height from the TEXT as well as the image.Set these properties in your XML:
Of course this only works if you want no text (worked for me).
Without these changes, the
CheckBox
was giving me a big margin around my image, as mentioned by Joe