Button 无线电地面布局(安卓)?
我需要4个单选按钮在一个单选组,但我需要他们在一个正方形模式2x2,而不是所有的水平或垂直。我尝试用radiogroup环绕线性布局,但没有成功。我应该怎么做才能得到正确的布局?以下是我拥有的xml:Button 无线电地面布局(安卓)?,button,layout,radio-button,Button,Layout,Radio Button,我需要4个单选按钮在一个单选组,但我需要他们在一个正方形模式2x2,而不是所有的水平或垂直。我尝试用radiogroup环绕线性布局,但没有成功。我应该怎么做才能得到正确的布局?以下是我拥有的xml: <RadioGroup android:layout_width="match_parent" android:layout_height="wrap_content" > <Li
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="horizontal">
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical">
<RadioButton android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:checked="false"
android:text="Q2"
android:layout_marginLeft="90dp"
android:id="@+id/rbQ2V">
</RadioButton>
<RadioButton android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:checked="false"
android:text="Q3"
android:layout_marginLeft="90dp"
android:id="@+id/rbQ3V">
</RadioButton>
</LinearLayout>
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical">
<RadioButton android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:checked="true"
android:text="Q1"
android:layout_marginLeft="5dp"
android:id="@+id/rbQ1V">
</RadioButton>
<RadioButton android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:checked="false"
android:text="Q4"
android:layout_marginLeft="5dp"
android:id="@+id/rbQ4V">
</RadioButton>
</LinearLayout>
</LinearLayout>
</RadioGroup>