1

I try to create a RecyclerView which has to be in the bottom of my View and I want to be able to scroll the RecyclerView so I added a NestedScrollView. But the problem is : when the RecyclerView has too many items, I'm not able to scroll and even worse because the items go the top of the screen and overlap with the rest of my layout.

<ConstraintLayout
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="wrap_content">

       <unrelated data>...</unrealated data>

       <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="12dp"
        app:layout_constraintTop_toBottomOf="@+id/XXX"
        tools:layout_editor_absoluteX="0dp">

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

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:overScrollMode="never"
            android:scrollbars="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent" />
        </LinearLayout>

    </androidx.core.widget.NestedScrollView>


</ConstraintLayout>
Kolya
  • 99
  • 2
  • 10
  • what do you have set for your ConstraintLayout attributes? – TomD Jul 12 '19 at 00:41
  • I solved the problem thanks to this post https://stackoverflow.com/questions/45397199/android-recylerview-in-constraintlayout-doesnt-scroll – Kolya Jul 12 '19 at 11:01

0 Answers0