最近在尝试实现一个滑动下方的UITableView,可以改变上方view的大小的功能,类似B站中竖屏视频的功能,刚好记录一下UIScrollView滑动时调用的顺序,代码中添加了以下代码
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
NSLog(@"scrollViewDidScroll...");
}
- (void)scrollViewDidZoom:(UIScrollView *)scrollView {
NSLog(@"scrollViewDidZoom...");
}
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
NSLog(@"scrollViewWillBeginDragging...");
}
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
NSLog(@"scrollViewWillEndDragging...");
}
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView {
NSLog(@"scrollViewWillBeginDecelerating...");
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
NSLog(@"scrollViewDidEndDecelerating...");
}
拖动UITableView,发现调用的顺序如下
先调用scrollViewWillBeginDragging...
接下来若干scrollViewDidScroll...
再调用scrollViewWillEndDragging...
调用scrollViewWillBeginDecelerating...
若干scrollViewDidScroll...
最后scrollViewDidEndDecelerating...
网友评论