0

I have looked at multiple examples and I'm also aware this is not good practice, but is there anyone that could help me with this issue. My first list is displayed correctly, but my second is collapsed and has it's own scroll view. I would like to have a scroll view for the entire page rather than for the individual list views.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".EtsiActivity">

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fillViewport="true"
        >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_marginBottom="?android:attr/actionBarSize">>

        <TextView
            android:layout_height="20dp"
            style="?android:attr/listSeparatorTextViewStyle"
            android:text="ETSI ERROR COUNT"
            android:id="@+id/StatusHeader"
            android:textColor="@color/primary"
            android:layout_marginTop="5dip"
            android:layout_marginLeft="5dp" />


            <ListView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/etsiStatus"
                android:layout_below="@+id/StatusHeader"
                android:gravity="center_horizontal">
            </ListView>

        <TextView
            android:layout_height="20dp"
            style="?android:attr/listSeparatorTextViewStyle"
            android:text="TS MAP"
            android:id="@+id/TSHeader"
            android:textColor="@color/primary"
            android:layout_marginTop="5dip"
            android:layout_marginLeft="5dp"
            android:layout_below="@id/etsiStatus"/>

            <ListView android:id="@+id/TSList"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/TSHeader"
                android:gravity="center_horizontal"
                />

        </LinearLayout>
    </ScrollView>

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:menu="@menu/bottom_navigation_menu"
        android:background="?android:attr/windowBackground" />

</RelativeLayout>

1 Answers1

0

I believe a NestedScrollView is what you want. Take a look at Android: ScrollView vs NestedScrollView

user3170251
  • 196
  • 13