UIAccelerometer 和 UIScrollView
我想根据 UIAccelerometer 值滚动滚动视图。实现这一目标的最佳方法是什么?
最初,我根据获得的加速度计值将内容偏移设置为一个值。然后,在每个 scrollViewDidEndAnimating
上,我再次根据加速度计值设置内容偏移量。我知道 setContentOffset
实际上以均匀的速度滚动滚动视图,没有任何加速。然而,这种机制在滚动滚动视图时似乎非常不稳定。
任何想法将不胜感激。
感谢和问候
I want to scroll a scrollview based on the UIAccelerometer values. What is the best way to accomplish this?
Initially I set the content offset to a value based on the accelerometer values I get. Then on each scrollViewDidEndAnimating
, I again set the content offset based on the acceleromter values. I understand that setContentOffset
actually scrolls the scrollview with a uniform velocity without any acceleration. However this mechanism seems to be very jerky in scrolling the scrollview.
Any ideas will be appreciated.
Thanks and Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我这样做过一次。
sv
是滚动视图。I did this once.
sv
is the scroll view.