2010-12-04 17 views
8

我不明白为什么我的单选按钮不在同一行上,我粘贴了我的代码到目前为止 - 我知道它与教程不一样,但我真的想要理解每一行,所以想知道什么相当于'浮动'是在Android - 尝试玩重力,重量等,但似乎并没有把它们放在一条线上..在一条线上显示单选按钮?

非常感谢提前!

<RadioGroup 
android:id="@+id/RadioGroup01" 
android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
android:layout_column="0" 
android:layout_span="3"> 

    <RadioButton 
     android:id="@+id/RadioButton01" 
     android:layout_height="wrap_content" 
     android:freezesText="true" 
     android:textSize="10sp" 
     android:text="15%" android:layout_width="wrap_content"> 
    </RadioButton> 

<RadioButton android:id="@+id/RadioButton02" android:layout_height="wrap_content" android:text="20%" android:textSize="10sp" android:layout_width="wrap_content"> 

+0

什么是他们周围的布局? – EboMike 2010-12-04 23:43:17

回答

33

添加android:orientation="horizontal"到RadioGroup中(见线的main.xml例如61从您发布的链接教程)。

+0

啊辉煌 - 认为这是与手机定位,现在有道理,谢谢! – Alphatester77 2010-12-05 09:43:00

0

<RadioGroup尝试这条线 android:orientation="horizontal"