Как задать размер scrollview

Как задать размер scrollview списка так как он проваливаеться в блоки На фото видно элемент bottomnavigation и кнопка, которая провалилась: введите сюда описание изображения

Вот грубо говоря элемент: введите сюда описание изображения

я не делаю в редакторе,а пишу всё кодом, но код очень велик. Также я использую разметку RelativeLayout


Ответы (2 шт):

Автор решения: Wlad
<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <LinearLayout
        android:id="@+id/mainContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <Button
            android:id="@+id/button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Button" />

        <Button
            android:id="@+id/button2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Button" />

        <LinearLayout
            android:id="@+id/footer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="bottom"
            android:orientation="vertical">

            <Button
                android:id="@+id/button4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Button" />
        </LinearLayout>
    </LinearLayout>
</ScrollView>
→ Ссылка
Автор решения: Vind Iskald

Если scrollview и bottom_navigation расположены в контейнере RelativeLayout необходимо scrollview добавить аттрибут

android:layout_above="@+id/bottom_navigation"
→ Ссылка