如何更改“setContentOffset”的滚动视图速度?
scrollView.setContentOffset(CGPoint(x: 120.5, y: 0), animated: true)
答案 0 :(得分:0)
在动画块中包裹setContentOffset(offset, animated: false)
UIView.animate(withDuration: 0.5, animations: {
scrollView.setContentOffset(CGPoint(x: 0, y: yOffset), animated: false)
})