我在单选按钮组内有 2 个单选按钮。现在它们垂直排列。我尝试将它们放入水平容器中,但没有用。
有没有办法让一组单选按钮水平排列?
<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" />
Add android:orientation="horizontal"
to RadioGroup
tag:
<RadioGroup
android:id="@+id/radioSex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation='horizontal'>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)