match_parent - > The element occupies the total of its parent element.
wrap_content - > The element will expand only enough to contain the values / elements it contains.
To get what you want you must add the following code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:background="@color/color0"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:background="@color/color"
android:layout_margin="8dp"
android:id="@+id/llayout"
android:layout_width="match_parent"
android:layout_height="200dp"
android:orientation="vertical">
<!--elementos-->
</LinearLayout>
<ScrollView
android:background="@color/color1"
android:layout_margin="8dp"
android:layout_below="@+id/llayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:background="@color/color2"
android:layout_margin="8dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--elementos-->
<View
android:layout_weight="1"
android:layout_margin="8dp"
android:layout_width="match_parent"
android:layout_height="500dp"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
You will get the following:
It should be mentioned that at your first LinearLayout
you must assign a static layout_height android:layout_height="200dp"
in this case as an example I put 200dp
but you will modify it according to your needs. besides eliminating the el% View
in ScroollView
> LinearLayout
put only to note the organization of the elements.