Recyclerview scrollToPosition doesn't work with NestedScrollView ? Is there anyway?

858 views
Skip to first unread message

Bincy Baby

unread,
Jul 19, 2017, 8:36:12 AM7/19/17
to Android Query


So I have a Recyclerview within a NestedScrollView. When I say recycleview.scrollToPosition(X) or recycleview.getLayoutManager().scrollToPosition(X) it doesn't work at all.

If I move the recycleview out from the nestedScrollView it works fine, but I can't do it, because of the layout structure! Any idea?

Abdul Samad Qurashi

unread,
Jul 20, 2017, 1:20:34 AM7/20/17
to androi...@googlegroups.com
try doing recyclerView.post(new Runnable(){
recycleview.scrollToPosition(X) or recycleview.getLayoutManager().scrollToPosition(X);
})

On Wed, Jul 19, 2017 at 5:36 PM, Bincy Baby <bbinc...@gmail.com> wrote:


So I have a Recyclerview within a NestedScrollView. When I say recycleview.scrollToPosition(X) or recycleview.getLayoutManager().scrollToPosition(X) it doesn't work at all.

If I move the recycleview out from the nestedScrollView it works fine, but I can't do it, because of the layout structure! Any idea?

--
You received this message because you are subscribed to the Google Groups "Android Query" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-query+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages