Приведенный ниже файл макета должен дать вам представление о том, что мне нужно содержимое прокрутки внутри RelativeLayout под TextView, но содержимое ScrollView выходит из RelativeLayout, чтобы быть скрытым за TextView. Я не понимаю, как это происходит. В RelativeLayout внутри ScrollView я добавляю объект LinearLayoutCompat программно, и к этому объекту я добавляю несколько объектов AppCompatTextView также программно. На скриншоте всего 1 экземпляр макета.
Я устанавливаю вложенный RelativeLayout для запуска под TextView, но все же он начинается с самого верха.
layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/narrowTextnon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/cherryRed"
android:elevation="8dp"
android:gravity="center"
android:layout_marginTop="15dp"
android:padding="25dp"
android:text="Let's narrow down now !"
android:textColor="@color/wineBrown"
android:textSize="22sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/narrowTextnon"
android:gravity="center">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/dataContnon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</RelativeLayout>