是否有办法知道动画何时结束并且uiscrollview已停止。
我这样做是因为有时使用委托对我来说并不实用,就像我在UIViewController转换中那样:
[UIView animateWithDuration:0.3 animations:^{
[scrollView setContentOffset:CGPointMake(0, -scrollView.contentInset.top) animated:NO];
} completion:^(BOOL finished) {
// This is called when it's complete
}];
以下列方式为UIScrollView实现UIScrollViewDelegate委托方法:
使用scrollViewDidEndScrollingAnimation:
来检测通过调用setContentOffset:animated:
或scrollRectToVisible:animated:
方法(使用动画:是)启动滚动时滚动动画何时结束。
如果要监视由触摸手势启动的滚动视图运动,请使用scrollViewDidEndDecelerating:
方法,当滚动运动停止时调用该方法。
scrollViewDidEndDecelerating:
UIScrollView委托方法在scrollView完全停止时被调用。