Algorithm to implement kinetic scrolling

后端 未结 5 577
耶瑟儿~
耶瑟儿~ 2021-01-30 03:09

What are some good algorithms for creating a kinetic scrolling implementation? The feature would be tested on a custom UI list. While I am targeting mobile devices (those that d

5条回答
  •  不要未来只要你来
    2021-01-30 04:04

    Since this was originally asked, I have since carefully read the source code for pastrykit, the framework in which apple has exactly duplicated their kinetic scrolling in javascript. There is no particle physics loop- The velocity of the touch is measured at the exact moment that the finger is lifted. From that point forward, the scroll is animated using a simple easing function that uses the velocity as an input parameter.

提交回复
热议问题