recyclerview-playground icon indicating copy to clipboard operation
recyclerview-playground copied to clipboard

Not working when enclosed inside a NestedScrollView

Open saurabharora90 opened this issue 6 years ago • 1 comments

For my use case, I had to include a RecylerView a NestedScrollVIew. Once I do that, the layout manager does not work anymore. I thought it would be a height issue so I modified the FixedGridLayoutManager to include setAutoMeasureEnabled(true). That caused the content to show up but the scrolling would not happen.

I also tried enabling and disabling NestedScrolling on the RecyclerView.

Sample:


<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/rvFanClubs"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:paddingLeft="12dp"
        android:paddingRight="12dp" />

</android.support.v4.widget.NestedScrollView>

saurabharora90 avatar Sep 17 '17 03:09 saurabharora90

@saurabharora90 I'd advice you to replace the NestedScrollView with a RecyclerView with a single view adapter and see if it fixes the issue

LouisCAD avatar May 20 '18 01:05 LouisCAD