Share the post "How To Increase Space Between Icon And Text In Android CheckBox"
So you want to change the drawable image of your CheckBox widget but when you compile the app, the image and the text are almost side by side.
I bet you used the attribute android:button in order to do this. This is the culprit. To change the CheckBox image with your own custom images, use the attribute android:drawableLeft.
But wait! Now, there are 2 CheckBox widget images!
Here is the complete XML code to use your custom CheckBox images as well as increasing the space between the icon and the text.
|
1 2 3 4 5 |
<CheckBox ... android:button="@android:color/transparent" android:drawableLeft="@drawable/checkbox" android:drawablePadding="10dp" /> |
The Sci Tech Daily is one of my favorite portals when I read any 