2014-03-28 81 views
0

在小设备上,ok按钮不会显示在我的对话框中。为了节省罗马,我想知道是否有办法让我的单选按钮绘制水平(所以按钮在同一行),而不是垂直。我的XML代码有没有办法让单选按钮水平绘制而不是垂直?

    <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Auto Play Back" 
      android:layout_gravity="center" 
      android:textColor="#fffff109" 
      android:textStyle="bold" 
      android:textSize="24px" 

      /> 

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

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

    <RadioButton 
     android:id="@+id/radioOff" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Off" /> 

</RadioGroup> 
    </LinearLayout>   

回答

0
android:orientation="horizontal" 

将此添加到RadioGroup中,它应该可以解决您的问题。

0

是的,RadioGroup中具有您可以设置取向性。

+0

重复http://stackoverflow.com/questions/11443492/is-there-a-way-to-have-a-radio-group-be-laid-out-horizo​​ntally?rq=1 ?? – RobP

相关问题