Android 有没有办法让无线电广播组水平布置?

Android 有没有办法让无线电广播组水平布置?,android,Android,我有两个单选按钮在一个广播组内。现在它们是垂直排列的。我试着把它们放在一个水平的容器里,但它不起作用 有没有办法让单选按钮组水平排列 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"

我有两个单选按钮在一个广播组内。现在它们是垂直排列的。我试着把它们放在一个水平的容器里,但它不起作用

有没有办法让单选按钮组水平排列

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<RadioGroup
    android:id="@+id/radioSex"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <RadioButton
        android:id="@+id/radioChats"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Chats" 
        android:checked="true" />

    <RadioButton
        android:id="@+id/radioPlayers"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Players" 
        android:checked="true" />

    </RadioGroup>

<Button android:text="Home" 
    android:id="@+id/buthome"
     android:paddingTop="-15dip"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" />

    <Button android:text="Players" 
       android:id="@+id/butplayers"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" />

  <TextView 
        android:id="@+id/viewActivePlayer" 
      android:layout_width="wrap_content" 
         android:layout_height="wrap_content"
      android:text="TedP" 
      android:layout_gravity="right" 
         android:textColor="#fffff109"
    android:textSize="26dip" />    



添加
android:orientation=“horizontal”
RadioGroup
标签:

<RadioGroup
   android:id="@+id/radioSex"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content" 
   android:orientation='horizontal'>

您也可以通过编程方式进行设置:

myRadioGroup.setOrientation(LinearLayout.HORIZONTAL);

RadioGroup扩展了LinearLayout,因此它继承了LinearLayout的特性,请参见