question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RecyclerView render issue if wrapped inside NestedScrollView

See original GitHub issue
  • [x ] I have searched existing issues and confirmed this is not a duplicate

Issues and steps to reproduce

RecyclerView is not showing all items when list is long when used with FlexboxLayoutManager

  1. Wrap RecyclerView with android:nestedScrollingEnabled="false" inside NestedScrollView
  2. Create and add FlexboxLayoutManager to RecyclerView
  3. Load recycler view with long list of items

Expected behavior

RecyclerView should render all items

Version of the flexbox library

0.3.1, 0.3.2

Code example based on repro steps

<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
   android:id="@+id/nested_scroll_view"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:fillViewport="true"
   android:scrollbars="none"
   app:layout_behavior="@string/appbar_scrolling_view_behavior">
       <android.support.v7.widget.RecyclerView
           android:id="@+id/recycler_view"
           android:nestedScrollingEnabled="false"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
       />
</android.support.v4.widget.NestedScrollView>
RecyclerView.LayoutManager layoutManager = new FlexboxLayoutManager(this.getContext());
mRecyclerView.setLayoutManger(layoutManager);

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
thagikuracommented, Jan 26, 2018

Oh so the actual XML was different from the one you pasted in the first comment. Understood.

0reactions
punitshah89commented, Jan 26, 2018

Yes we can add root element to all views and screen is scrollable, in my case I’m using RelativeLayout and following structure.

<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
   android:id="@+id/nested_scroll_view"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:fillViewport="true"
   android:scrollbars="none"
   app:layout_behavior="@string/appbar_scrolling_view_behavior">

<RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

<Otherviews />
<CustomRecyclerView />

</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use RecyclerView inside NestedScrollView?
I experience one issue putting my RecyclerView inside the NestedScrollView. I realized that scrolling the content of my RecyclerView slacked.
Read more >
RecyclerView within NestedScrollView Scrolling Issue - Medium
As we already know that recyclerView has a smooth scrolling by itself but when we need to put recyclerView within any scrollView it...
Read more >
What Is The Equivalent Of [Nestedscrollview + Recyclerview ...
RecyclerView render issue if wrapped inside NestedScrollView #400 Wrap RecyclerView with android:nestedScrollingEnabledfalse inside is scrollable in my case ...
Read more >
Weird behaviour of RecyclerView inside NestedScrollView.
We solved that by rendering the recyclerview into a bitmap, then scrolling the recyclerview into position and rendering again, stiching it to ...
Read more >
Handling Scrolls with CoordinatorLayout - CodePath Cliffnotes
When a Snackbar is rendered, it normally appears at the bottom of the visible ... Scroll events in the RecyclerView trigger changes inside...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found