本文介绍了如何测试滚动视图是否弹跳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何测试滚动视图是否弹跳?反弹结束时是否有通知或其他内容?
How can I test if the scroll view is bouncing? Is there a notification or something when the bounce ends?
推荐答案
是...查看UIScrollViewDelegate规范,实现包括下面两个,并相应地设置你的UIScrollView的委托:
Yes... check out the UIScrollViewDelegate spec, implement the methods including the two below, and set your UIScrollView's delegate accordingly:
// User stops dragging the table view.
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView
willDecelerate:(BOOL)decelerate;
// Control slows to a halt after the user drags it
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;
您可能对scrollViewDidEndDecelerating最感兴趣。这些也可以在我最初找到它们的UITableView中工作(UITableView继承自UIScrollView)。
You will probably be most interested in scrollViewDidEndDecelerating. These also work in UITableView which is where I originally found them (UITableView inherits from UIScrollView).
这篇关于如何测试滚动视图是否弹跳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!