Greum
Well-Known Member
I have a set of 3 radio buttons defined in a single row as follows:
Is it possible to define the buttons so that they are in a single row if there's room or wrapped with 2 on the first line and the third on a second line if there's not room for them all? Or is it a question of designing for the lowest common denominator (smallest device)?
Code:
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/checkBox2">
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="6dp"
android:checked="true"
android:text="@string/single_prop" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:text="@string/investor" />
<RadioButton
android:id="@+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="0dp"
android:text="@string/first_timer" />
</RadioGroup>
Is it possible to define the buttons so that they are in a single row if there's room or wrapped with 2 on the first line and the third on a second line if there's not room for them all? Or is it a question of designing for the lowest common denominator (smallest device)?