I have a very simple custom checkbox selector:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@drawable/ui_checkbox_checked" />
<item android:drawable="@drawable/ui_checkbox" />
</selector>
that I'm setting using the following code:
<CheckBox android:id="@+id/checkbox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:button="@drawable/checkbox_selector"
android:textSize="12dp"
android:text="checkbox 1"
/>
The custom checkbox image is smaller than the standard image that comes with Android, but the text is still in exactly the same spot, as if the larger image were still being used.
So instead of looking like [X]_checkbox 1
it looks like [X]____checkbox 1
with a big space between the box and the text. How can I fix this?