开发者

Need to change layout of radio buttons

I've got 2 radio buttons and i want to put them nex开发者_如何学Pythont to each other. Right now theyre like

Radio button 1
Radio button 2

i want to make it

Radio button 1    Radio button 2

This is my code for the radio buttons, any help?

    <RadioGroup
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical">
  <RadioButton android:id="@+id/radio_male"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Male" 
      android:layout_below="@id/gender"/>
  <RadioButton android:id="@+id/radio_female"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Female" />
</RadioGroup>


Did you spend any time on this at all?

Maybe the android:orientation="vertical" means something.


There's no difference in the "before" and "after" layouts as you've written them...

But be that as it may: you have android:orientation="vertical" in your XML. Try android:orientation="horizontal"; that should put them on the same line, next to each other.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜