Four kinds of scrolling of recyclerview

scrollBy

        Control the distance of movement by yourself. The unit is pixel. When you use it, you need to calculate the height or width of the movement yourself.

 

scrollToPosition

        Positioning to a specified item is to display the item you want to display, but you are not sure where it will be displayed. As long as you can see that item, it will not slide.

 

smoothScrollToPosition    

        The same effect as scrollToPosition, the difference is that smoothScrollToPosition is smoothed to the item you want to display, while scrollToPosition is displayed directly.

 

scrollToPositionWithOffset

        Navigate to the specified item and display it on top if it can be pinned.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325609467&siteId=291194637