UIScrollViewDelegate的回调方法解析

- (void)scrollViewDidScroll:(UIScrollView *)scrollView;              //当视图滚动时                              

- (void)scrollViewDidZoom:(UIScrollView *)scrollView//当视图缩放结束时

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView;//即将开始拖拽视图时

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset//即将结束拖拽操作时

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;//当拖拽操作结束时

- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView;   //视图即将开始减速时

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;     //视图减速完毕

- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView; //当滚动视图动画执行结束时,没添加动画不调用

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView; //视图缩放过程中调用,会多次调用

- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view; //视图开始缩放时调用

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale; //视图缩放结束,并且缩放比例回到minimumZoomScale与maximumZoomScale之间后(我们也许会超出缩放范围)调用

- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView;  //当用户点击状态栏时是否回到顶部(只有当滚动视图不在顶部时才会调用)

- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView;     //当视图回到顶部时调用


执行顺序:

scrollViewWillBeginDragging

scrollViewDidScroll

scrollViewWillEndDragging

scrollViewDidEndDragging

scrollViewWillBeginDecelerating

scrollViewDidScroll

scrollViewDidEndDecelerating

你可能感兴趣的:(IOS,UI)