Goofy
Goofy

Reputation: 6128

Radio button icon overlaps on text only in Android 4.2.2 devices.

This is my code:

<RadioButton
        android:id="@id/all_questions_button"
        android:layout_marginRight="1dp"
        android:layout_weight="1.0"
        android:button="@drawable/icon"
        android:gravity="center"
        android:height="30dip"
        android:textColor="#FFF"/>

This code works perfectly fine in devices with android version below 4.2.2, but in device with android 4.2.2 the text is placed below the radio button icon.

How to solve this?

Upvotes: 1

Views: 1613

Answers (2)

Goofy
Goofy

Reputation: 6128

Ok, i have fixed it by myself, added android:paddingRight="-30dp" to the xml and now the icon does not overlap on text.

Hope it will help some one in future.

Happy Coding :)

Upvotes: 1

Hareshkumar Chhelana
Hareshkumar Chhelana

Reputation: 24848

// try this
  <RadioButton
        android:id="@+id/all_questions_button"
        android:layout_marginRight="1dp"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="30dp"
        android:button="@drawable/icon"
        android:gravity="center"
        android:textColor="#FFFFFF"/>

Upvotes: 0

Related Questions