Recyclerview Inside Nested Scrollview Scroll But Does Not Fast Scroll Like Normal Recyclerview or Nested Scrollview

Recyclerview inside Nested Scrollview scroll but does not fast scroll like normal Recyclerview or Nested Scrollview

try

recyclerView.setNestedScrollingEnabled(false);

recyclerview inside nested scroll view is not scolling

After many tries, I've found the solution

which is to change the recyclerView's height to be wrap_content instead of match_parent or 0dp so the recyclerView would be like this:

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/profile_details_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_xxdim"
android:clipToPadding="false"
android:paddingBottom="@dimen/default_dim"
android:paddingStart="@dimen/default_dim"
android:nestedScrollingEnabled="false"
app:layout_constraintBottom_toBottomOf="parent"
android:focusable="false"
app:layout_constraintTop_toBottomOf="@id/profile_name"
/>

Recyclerview inside ScrollView not scrolling smoothly

Try doing:

RecyclerView v = (RecyclerView) findViewById(...);
v.setNestedScrollingEnabled(false);

As an alternative, you can modify your layout using the support design library. I guess your current layout is something like:

<ScrollView >
<LinearLayout >

<View > <!-- upper content -->
<RecyclerView > <!-- with custom layoutmanager -->

</LinearLayout >
</ScrollView >

You can modify that to:

<CoordinatorLayout >

<AppBarLayout >
<CollapsingToolbarLayout >
<!-- with your content, and layout_scrollFlags="scroll" -->
</CollapsingToolbarLayout >
</AppBarLayout >

<RecyclerView > <!-- with standard layoutManager -->

</CoordinatorLayout >

However this is a longer road to take, and if you are OK with the custom linear layout manager, then just disable nested scrolling on the recycler view.

Edit (4/3/2016)

The v 23.2 release of the support libraries now includes a factory “wrap content” feature in all default LayoutManagers. I didn’t test it, but you should probably prefer it to that library you were using.

<ScrollView >
<LinearLayout >

<View > <!-- upper content -->
<RecyclerView > <!-- with wrap_content -->

</LinearLayout >
</ScrollView >

recyclerview inside nestedscrollview loading slow

I solved the problem using coordinatorlayout/collapsingtoolbar.

RecyclerView nested in LinearLayout as well as Scrollview not scrolling to specific recycler item position

Why you use the nestedScollView smoothScrollTo with the position you have to give x,y coordonate i think in your case you can use recycleView.smoothScrollToPosition(yourPosition);



Related Topics



Leave a reply



Submit