0

Is it possible to create a RadioGroup that will hold radio buttons by 3 in a row? I've checked the internet for an implementation and I found one, but it was not working. The thing is that I need to add them programatically, and they should be grouped 3 per row.

Can someone tell me how can I populate a radioGroup with RadioButtons so they are aligned 3 per row.

Thanks

Darko Petkovski
  • 3,892
  • 13
  • 53
  • 117
  • I am facing the same problem.see:-http://stackoverflow.com/questions/32846410/how-to-align-radiobuttons-in-a-radiogroup may be it h – AbhayBohra Sep 29 '15 at 17:56

2 Answers2

0

Radiogroup inherits from LinearLayout.
So, set the RadioGroup orientation attribute to "horizontal"

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
0

Radio Group inherits from the LinearLayout ViewGroup so you can make this possible by setting orientation on the viewgroup android:orientation="horizontal"

  <RadioGroup
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <RadioButton
        android:text="Radio 1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <RadioButton
        android:text="Radio 2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <RadioButton
        android:text="Radio 3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</RadioGroup>
kandroidj
  • 13,784
  • 5
  • 64
  • 76