iPhone/iPad 上滚动条的加速度/速度公式?
我正在尝试模拟 iOS 中的滚动列表视图,您可以在其中缓慢滚动,或者用动量轻弹,它会滚动直到减速并停止。我知道一定有一种方法可以对这种行为进行数学编程(测量过去 X 毫秒内滚动了多少像素),但我的数学很烂。是的,我意识到有几个插件可以实现此目的,但我宁愿从头开始(出于学习目的)。
任何建议都会很棒!
I'm trying to emulate the scrolling list views in iOS, where you can scroll slowly, or flick with momentum and it scrolls till it decelerates and stops. I know there must be a way to mathematically program this behavior (something about measuring how many pixels were scrolled in the past X millseconds), but I suck at math. And yes, I realize there are a couple plug-ins for this, but I'd rather do this from scratch (for learning purposes).
Any advice would be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这看起来像您想要的:
http://www.developria。 com/2010/09/elastic-scrolling-with-javascr.html
This looks like what you want:
http://www.developria.com/2010/09/elastic-scrolling-with-javascr.html
您是否检查过我在博客中写的有关此主题的内容:带有动量滚动和减速的轻弹列表?
Have you checked what I've written about this topic in my blog: flick list with its momentum scrolling and deceleration?