0

Here is the portion of XML that I have in my Android Layout file that should generate a RadioGroup with three RadioButtons inside:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <RadioButton
            android:id="@+id/radbtnAlways"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:checked="true"
            android:text="@string/radiobutton_Always" />

        <RadioButton
            android:id="@+id/radbtnNever"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/radiobutton_Never" />

        <RadioButton
            android:id="@+id/radbtnCost_Change"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/radiobutton_Cost_Change" />

    </RadioGroup>
</LinearLayout>

However, all I see where these widgets should be is a bluish outline of what appears to be the state of Colorado - it is too large, and displays no RadioButtons:

enter image description here

Why is my RadioGroup so large, and why do the RadioButtons do a George Jones imitation?

UPDATE

In answer to CommonsWare, here's what it looks like in the Emulator (pretty much the same):

enter image description here

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 2
    If your screenshot is from some graphical preview, try it on a device or emulator. If your screenshot is from a device or emulator, use Hierarchy View (emulator) or **`uiautomatorviewer`** (device) to get a better sense of what is going on. All that being said, the use of `android:layout_weight` to control the height is at odds with your height being `wrap_content`. – CommonsWare Jun 04 '14 at 19:17
  • It's from Droidio at design time. Removing layout_weight from the RadioButtons made no diff. – B. Clay Shannon-B. Crow Raven Jun 04 '14 at 20:26
  • can you please post whole xml code ? – Haresh Chhelana Jun 05 '14 at 04:28

1 Answers1

1

Remove these two properties from all the RadioButtons:

android:layout_width="0dip"
android:layout_weight="1"

So it now looks better:

enter image description here

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • I will when I can; StackOverflow makes you "cool down" before you can accept your own answer. I have an article about this here: http://www.codeproject.com/Articles/782206/How-to-Use-an-Android-Layout-Mockup-Utility-that-G – B. Clay Shannon-B. Crow Raven Jun 05 '14 at 15:13