LinearLayoutManager's scrollToPositionWithOffset with smooth animation?
Asked Answered
T

0

6

I'm working with a RecyclerView and I want the clicked item to be scrolled to the top of the RecyclerView. I tried the smooth scrolling methods from RecyclerView but none of them work as I expect.

The only one working is scrollToPositionWithOffset from LinearLayoutManager, but there is no smooth animation: item jumps directly to the top.

Is there any way to achieve a smooth animation for this scrollToPositionWithOffset method?

Titanic answered 20/10, 2017 at 14:27 Comment(4)
use smoothScrollToPosition method .Dioptrics
It doesn't work as I want. It doesn't scroll the clicked item all the way to the topTitanic
smoothScrollToPosition as well as scrollToPosition only make the item visible, but they don't position it at the top. Any suggestion? Looking at the source code does not help much :(Titanic
Possible duplicate of RecyclerView - How to smooth scroll to top of item on a certain position?Superiority

© 2022 - 2024 — McMap. All rights reserved.