【问题标题】:Slowing down UIScrollView scrolling减慢 UIScrollView 滚动
【发布时间】:2016-10-13 04:10:38
【问题描述】:

我正在使用 UIScrollView 以编程方式为某些内容设置动画。

但是,我需要减慢视图的滚动速度。

这是我用于滚动的代码:

self.scrollView.setContentOffset(CGPoint(x: 0, y: self.view.frame.height), animated: true)

我已尝试添加 scrollView.decelerationRate = UIScrollViewDecelerationRateFast,但似乎不起作用。

【问题讨论】:

    标签: ios swift uiscrollview


    【解决方案1】:

    试试下面的代码:

    UIView.animate(withDuration: 1.5) { 
        self.scrollView.contentOffset = CGPoint(x: 0, y: self.view.frame.height)
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-05
      • 1970-01-01
      • 1970-01-01
      • 2013-03-23
      • 1970-01-01
      • 2011-08-01
      • 1970-01-01
      • 2012-05-10
      相关资源
      最近更新 更多