禁用屏幕顶部的UIScrollView弹跳 [英] Disable UIScrollView bounce at the top of the screen

查看:480
本文介绍了禁用屏幕顶部的UIScrollView弹跳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用中有UIScrollView,启用了垂直跳出功能。我需要屏幕底部的反弹但屏幕顶部没有启用。

I have UIScrollView in my app with vertical bounce enabled. I need the bounce at the bottom of the screen but not enabled at the top of the screen.

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

I no how to detect scrollview with the following:

  (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {

  // no bounce if scrollView has reached the top of the screen ??
  }


推荐答案

尝试设置<$ c滚动视图根据内容偏移滚动$ c>跳出属性:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    scrollView.bounces = (scrollView.contentOffset.y > 100);
}

这篇关于禁用屏幕顶部的UIScrollView弹跳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆