Nisarg
Nisarg

Reputation: 1388

ConstraintLayout (with RecyclerView ) inside NestedScrollView

I have a structure like this when I try to scroll outside area of RecyclerView its not working (scrolling)

<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 
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"  
android:fillViewport="true">

<androidx.constraintlayout.widget.ConstraintLayout
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <androidx.cardview.widget.CardView     
    </androidx.cardview.widget.CardView>

    <androidx.recyclerview.widget.RecyclerView
     />

</androidx.constraintlayout.widget.ConstraintLayout>

Any help on this !!!

Upvotes: 2

Views: 1620

Answers (2)

SanShaoTang
SanShaoTang

Reputation: 21

NestedScrollView wrap constraintlayout wrap

RecyclerView wrap

Upvotes: 1

Ivan Krasilnikov
Ivan Krasilnikov

Reputation: 261

You can try add this property for RecyclerView - android:nestedScrollingEnabled="false"

Upvotes: 0

Related Questions