4

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?

moyo
  • 492
  • 6
  • 22
  • use `smoothScrollToPosition` method . – KeLiuyue Oct 20 '17 at 14:33
  • It doesn't work as I want. It doesn't scroll the clicked item all the way to the top – moyo Oct 20 '17 at 14:41
  • 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 :( – moyo Oct 22 '17 at 11:33
  • 1
    Possible duplicate of [RecyclerView - How to smooth scroll to top of item on a certain position?](https://stackoverflow.com/questions/31235183/recyclerview-how-to-smooth-scroll-to-top-of-item-on-a-certain-position) – Anrimian Nov 11 '18 at 19:36

0 Answers0