Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

place 2 radio buttons next to each other (on one 'line') in a vertical layout

i have my controls in a vertical LinearLayout. All my controls are place below each other.

What i want to do is place a radio group (with 2 radio buttons) on one 'line'

How can i do that?

I tried wrapping it in a horizontal LinearLayout, but that didn't work out

like image 244
Michel Avatar asked Jan 23 '12 13:01

Michel


2 Answers

Use the android:orientation="horizontal"-attribute of the RadioGroup.

like image 155
Jave Avatar answered Sep 20 '22 14:09

Jave


    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:text="No Return"/>
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:text="Return"/>
    </RadioGroup>
like image 43
Hamza Rahman Avatar answered Sep 17 '22 14:09

Hamza Rahman