Michel
Michel

Reputation: 23615

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

Upvotes: 12

Views: 19349

Answers (2)

Hamza Rahman
Hamza Rahman

Reputation: 664

    <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>

Upvotes: 3

Jave
Jave

Reputation: 31846

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

Upvotes: 52

Related Questions