how can we arrange radio group's button as we want.. i don't want to arrange horizontally or vertically.. i want 2 radio buttons in a row and other two radio buttons in next row.. please help thank you in advance...
<LinearLayout
android:id="@+id/tt5"
android:layout_width="fill_parent"
android:layout_height="160dp"
android:layout_marginTop="165dp"
android:background="#fff" >
<ImageView
android:id="@+id/imageView7"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="3dp"
android:layout_marginTop="3dp"
android:src="@drawable/icongender" />
<RadioGroup
android:id="@+id/radiogrp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RadioButton
android:id="@+id/student"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:background="@drawable/edittext"
android:checked="true"
android:paddingLeft="10dp"
android:text="\t\tStudent"
android:textColor="#616161" />
<RadioButton
android:id="@+id/buisness"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:paddingLeft="10dp"
android:background="@drawable/edittext"
android:text="\t\tBuisness"
android:textColor="#616161" />
<RadioButton
android:id="@+id/entertainment"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:paddingLeft="10dp"
android:background="@drawable/edittext"
android:text="\t\tEntertainment"
android:textColor="#616161" />
<RadioButton
android:id="@+id/others"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:paddingLeft="10dp"
android:background="@drawable/edittext"
android:text="\t\tOthers"
android:textColor="#616161" />
</RadioGroup>
</LinearLayout>
my xml code is above.. this shows me 4 radio buttons in one column but i want 2 radio buttons in one row and other two in next row. please help thank you in advance
You can simply make each two RadioButton
s in one LinearLayout
which has an Horizontal
orientation. Or you can use GridLayout
.