I am doing an exercise from "Advanced Android Development Course". This code doesn't display RadioButtons
:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/my_fragment_color"
android:orientation="horizontal"
tools:context=".SimpleFragment">
<TextView
android:id="@+id/fragment_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
android:padding="10dp"
android:text="@string/question_article"/>
<RadioGroup
android:id="@+id/radio_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/radio_button_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:text="@string/yes"/>
<RadioButton
android:id="@+id/radio_button_no"
android:layout_marginRight="8dp"
android:text="@string/no"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RadioGroup>
RadioButtons
appear when I remove TextView
. How TextView
hid those buttons? I tried using also marginEnd
or weight atributes, but this wasn't a solution.