0

I just want my nested scrollview to scroll, I do not want the lists to scroll. For some reason the scrollview does not scroll. I looked into multiple posts related to nested scroll views, scroll views, with listview, none of the solution helped. It is strange that the scrollview is not working, I am not certain if I am missing something. Also, my listviews are of dynamic heights.

Here is my code:

<android.support.v4.widget.NestedScrollView
    android:id="@+id/ns_scroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/grey"
        android:orientation="vertical">

        <TextView
            style="@style/customFontStyleBook"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:padding="5dp"
            android:text="Heading 1"
            android:textColor="#000"
            android:textStyle="bold"/>


        <ListView
            android:id="@+id/ll1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/grey"
        android:orientation="vertical">

        <TextView
            style="@style/customFontStyleBook"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:padding="5dp"
            android:text="Heading 2"
            android:textColor="#000"
            android:textStyle="bold"/>

        <ListView
            android:id="@+id/ll2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

            </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/grey"
        android:orientation="vertical">

        <TextView
            style="@style/customFontStyleBook"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:padding="5dp"
            android:text="Heading 3"
            android:textStyle="bold"
            android:textColor="#000" />

        <ListView
            android:id="@+id/ll3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>

    </LinearLayout>
 </android.support.v4.widget.NestedScrollView>
Anubhav
  • 1,984
  • 22
  • 17
  • Your problem is solved? – MMG Apr 26 '20 at 04:34
  • Yes, I used a RecyclerView instead. So I was able to fix it with ListView as well. For ListView I had to write code for dynamic heights of the listview's, because of the dynamic and variable heights of the views. – Anubhav Apr 27 '20 at 06:02

0 Answers0