Share the post "Custom CheckBox Drawable Gets Cut Off In Android"
The solution to this problem is not to use the android:button attribute of the CheckBox widget. Instead, set it to null as well as the android:background attribute and use android:drawableLeft to assign your custom CheckBox drawable.
Here is the complete sample XML code:
|
1 2 3 4 5 6 |
<CheckBox android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="My Checkbox" android:id="@+id/checkboxid" android:button="@null" android:background="@null" android:drawableLeft="@drawable/mycustomdrawable" android:drawablePadding="10dp" /> |
The attribute android:drawablePadding is used to place a gap between the image and the text so this is fairly optional.