I have a RadioGroup
with radio buttons:
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/radioGroup1"
>
<RadioButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:checked="true"
android:text="AAA"
android:button="@null"
android:drawableLeft="@drawable/flag_icon"
android:drawableRight="@android:drawable/btn_radio"
android:drawablePadding="60dp"
android:id="@+id/radio2"/>
<RadioButton.../>
</RadioGroup>
As you see above, for the RadioButton
I defined the following attributes:
...
android:button="@null"
android:drawableLeft="@drawable/flag_icon"
android:drawableRight="@android:drawable/btn_radio"
...
So that the radio button is located on the right side of the radio button text. The left side of button text is a flag icon.
In order to have spaces between button text and flag icon and button icon, I use android:drawablePadding="60dp"
to space them.
However, with above code, the 60dp
padding space is applied to both left drawable (flag icon) and right drawable (radio button), which ends up with radio text located in the middle between the two drawables.
I would like to have radio button text and left drawable(flag icon) has smaller space between, while radio button text and right drawable (radio button) has larger space between. How to define the different spaces for left drawable and right drawable of radio button ?