10 uiscrollview uiscrollviewdelegate ios
有没有办法知道动画何时结束并且uiscrollview已经停止.
ban*_*isa 13
我是这样做的,因为有时使用委托对我来说不实用,就像我在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
}];
Run Code Online (Sandbox Code Playgroud)
按以下方式为 UIScrollView实现UIScrollViewDelegate委托方法:
当您通过调用或 方法(使用animated:YES)scrollViewDidEndScrollingAnimation:启动滚动时,用于检测滚动动画何时结束。setContentOffset:animated:scrollRectToVisible:animated:
如果要监视由触摸手势启动的滚动视图运动,请使用scrollViewDidEndDecelerating:方法,该方法在滚动运动停止时调用。
| 归档时间: |
|
| 查看次数: |
5786 次 |
| 最近记录: |