UIScrollViewDelegate相关方法

2017-09-13 20:43:40来源:cnblogs.com作者:轩辕辉人点击

分享

UIScrollViewDelegate

- (void)scrollViewDidScroll:(UIScrollView *)scrollView;//scrollview 滚动的时候调用该方法,任何 offset 值改变都会调用该方法.

- (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;//一次有效滚动,手指离开屏幕时执行一次(decelerate指手指放开时屏幕是否继续按惯性滚动)

 - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView;//滑动将要减速

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;//滚动停止

- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView;//滚动视图动画完成后调用

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView;//缩放视图

- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view;//视图将要缩放(一次有效缩放只执行一次)

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale;//视图缩放结束

- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView;//用户点击状态栏时,是否可以滚动到顶部

- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView; //滚动到顶部时调用该方法

UIScrollViewAccessibilityDelegate

- (NSString *)accessibilityScrollStatusForScrollView:(UIScrollView *)scrollView;//视图滚动的时候返回一个自定义的字符串

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台