What I\'m trying to accomplish: When the user clicks a specific RadioButton, a TextView should appear immediately below the selected RadioButton.
Two options:
RadioGroup
. Making the TextView
visible when the user clicks on the RadioButton
.ViewStub
. Check this link.Is putting the TextView inside of the RadioGroup valid (or, good practice)?
RadioGroup
is just a LinearLayout
that happens to also handle RadioButton
exclusion rules (i.e., "there can only be one...checked, that is"). I see no particular problems in having a TextView
inside a RadioGroup
.
yeah it is possible check this method
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/radioGroup"
android:orientation="horizontal">
<RadioButton
android:id="@+id/ifsc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ifsc"
android:textAllCaps="true" />
<Textview
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/appName"
android:id="@+id/ifsc_info"
android:baselineAlignBottom="true"
android:layout_toEndOf="@+id/ifsc" />
</RadioGroup>