0

I'm having an issue with RadioButton on Android API 16. This issue is not there on newer API level. I found many other problems related to RadioButton in API 16, but none of them resolves my issue. The text of the RadioButton starts inside the Checkbox, here is a screenshot. I hope someone can help me find a workaround, because I couldn't for now.

The height and width are in "wrap_content" The left one has a paddingRight="10dp" and the right one has a paddingLeft="10dp"

Text in inside the button

Thank you

Pygmay
  • 75
  • 2
  • 9

2 Answers2

0

just remove the padding if not necessary to you.. every thing will be on its place.

SRB Bans
  • 3,096
  • 1
  • 10
  • 21
0

So I found a workaround since I discovered what is the issue, thanks to sourabh and this post

On API <= 16 you can set padding left on the radio button to set the padding relative to the radio button's view bounds. Additionally a patch nine background also changes the view bounds relative to the view.

I also used this post to build my solution for the right button :

layout.xml

<RadioButton
    android:id="@+id/radio_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:test="some text"
    android:paddingLeft="@dimen/paddingLeft_radioButton" />

values/dimens.xml

<dimen name="paddingLeft_radioButton">43dp</dimen>

values-v14/dimens.xml

<dimen name="paddingLeft_radioButton">37dp</dimen>

values-v17/dimens.xml

<dimen name="paddingLeft_radioButton">10dp</dimen>
Community
  • 1
  • 1
Pygmay
  • 75
  • 2
  • 9