禁用屏幕顶部的UIScrollView弹跳

pet*_*ete 9 iphone ipad ios

我的应用程序中有UIScrollView,启用了垂直弹跳.我需要在屏幕底部弹跳但不在屏幕顶部启用.

我没有如何检测scrollview与以下内容:

  (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {

  // no bounce if scrollView has reached the top of the screen ??
  }
Run Code Online (Sandbox Code Playgroud)

Wai*_*ain 29

尝试bounces在滚动视图滚动时根据内容偏移设置属性:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    scrollView.bounces = (scrollView.contentOffset.y > 100);
}
Run Code Online (Sandbox Code Playgroud)