UIScrollViewDelegate
UIScrollViewDelegate
十八郎 发表于1年前
UIScrollViewDelegate
  • 发表于 1年前
  • 阅读 3
  • 收藏 0
  • 点赞 0
  • 评论 0

新睿云服务器60天免费使用,快来体验!>>>   

1、滚动时调用(只要offset改变就会调用)
- (void)scrollViewDidScroll:(UIScrollView *)scrollView;// any offset changes
2、即将拖拽
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView;
3、拖拽结束时调用 decelerate:是否有减速
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;
4、将要开始减速
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView;
5、结束减速
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;
6、 滚动动画完成后调用(调用下面两个方法(animated=YES)且动画完成时会调用
     /*scrollView scrollRectToVisible:<#(CGRect)#> animated:<#(BOOL)#>
        scrollView setContentOffset:<#(CGPoint)#> animated:<#(BOOL)#> )*/
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView;
//下面的方法平时很少使用
7、缩放时调用
- (void)scrollViewDidZoom:(UIScrollView *)scrollView; // any zoom scale changes
8、返回一个将被缩放的view,如果返回nil,则没有效果
- (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView;
9、scrollView的content缩放之前调用
- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view ;
10、缩放结束之后调用 (minimum <=scale <=maximum called after any 'bounce' animations)
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale;
11、是否滑动到最顶部,默认是YES
- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView;
12、滑动到顶部后调用 (如果已经在顶部,则无效)
- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView;
13、called on finger up if the user dragged. velocity is in points/millisecond. targetContentOffset may    
      be changed to adjust where the scroll view comes to rest
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset;

 

 

  • 打赏
  • 点赞
  • 收藏
  • 分享
共有 人打赏支持
粉丝 3
博文 72
码字总数 25921
×
十八郎
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: