У меня есть такой xml-файл:
UPD
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ProgramsFragment"
android:background="@color/colorPrimaryDark">
<!-- TODO: Update blank fragment layout -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numColumns="auto_fit"
android:columnWidth="200dp"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="16dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/your_articles"
android:gravity="center_horizontal"
android:textStyle="bold"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
Моя цель состояла в создании прокручиваемого макета, который содержит GridView и TextView.TextView лежит ниже GridView.Когда я запускаю мою программу, размер GridView становится маленьким, и я не знаю почему.Вероятно, в textview нет ничего, что могло бы изменить размер GridView таким образом (как я думаю).Но, возможно, я ошибаюсь, так как при удалении TextView, RelativeLayout и ScrollView все работает правильно.В чем дело?Вот экран моей проблемы:

UPD2
Я добавляю в GridView следующим образом:
private final String[] programs = {"Slim body for a four weeks", "Exercises for woman at home", "Effective exercises for biceps at home",
"Program of effective trainings twice a week", "Training on a horizontal bar for increasing muscle mass",
"Fitness program for woman: trainings at home at in gym"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1,programs);
GridView gridView = view.findViewById(R.id.gridView);
gridView.setAdapter(adapter);
UPD3
Я добавил строку android:background="@color/colorPrimaryDark"
в этот файл, и результат отображается на экране
.Как я понимаю, весь фрагмент занимает эту часть макета.Но почему?Есть несколько почти одинаковых фрагментов и они занимают все место.