Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unexpected RadioButton behavior

alt text

Here is my layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFFFF">

<RadioGroup
    android:id="@+id/choices_group"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:layout_centerInParent="true"
    android:orientation="vertical"
    android:background="@drawable/rounded_bg" >

    <RadioButton
        android:id="@+id/choice_a"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:padding="5dp"
        android:text="Choice A" />

    <RadioButton
        android:id="@+id/choice_b"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="Choice B" />

    <RadioButton
        android:id="@+id/choice_c"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="Choice C" />

    <RadioButton
        android:id="@+id/choice_d"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="Choice D" />
</RadioGroup>
</RelativeLayout>

Why are the radio buttons superimposed over the text?

like image 627
Ragunath Jawahar Avatar asked Dec 12 '22 17:12

Ragunath Jawahar


1 Answers

Problem was with the padding. Once I removed the padding, everything worked as usual. This might be a bug.

like image 183
Ragunath Jawahar Avatar answered Jan 15 '23 23:01

Ragunath Jawahar