SNM
SNM

Reputation: 6795

Nested RecyclerView with nestedscrollview is not scrolling

I have a row that has a recyclerview inside another recyclerview, like this image

enter image description here

I need the inner recyclerview to be able to scroll it, I have tried this (this is inside a ConstrainLayout)

<androidx.core.widget.NestedScrollView
    android:id="@+id/nested_scroll"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:fillViewport="true"
    app:layout_constraintTop_toBottomOf="@+id/constraintLayout">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rv_order_items"
        android:layout_width="match_parent"
        android:layout_height="0dp" />

</androidx.core.widget.NestedScrollView>

And

rv_order_items.isNestedScrollingEnabled = true

But I cant scroll inside the inner recyclerview, any suggestion?

Upvotes: 0

Views: 257

Answers (1)

Jaimil Patel
Jaimil Patel

Reputation: 1347

Please add whole code of your layout in this post so I will get idea about constraintlayout.


Otherwise this is solution if you want full screen to scroll...
Please set android:layout_height="match_parent" of NestedScrollView

<androidx.core.widget.NestedScrollView
android:id="@+id/nested_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">

Upvotes: 2

Related Questions