![](/img/trans.png)
[英]How to horizontally scroll between pages of controls in UIScrollView iOS/Swift
[英]How to adjust the scroll speed of UIScrollview in iOS swift?
我嘗試使用設置我自己的滾動速度
self.scrollView.decelerationRate = .init(rawValue: 0.20)
但是,這僅控制我想降低拖動本身的滾動速度的減速。
最后,我可以通過設置 scrollview 本身的內容偏移量來強制停止 scrollViewDidEndDragging 委托內的滾動。
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
//check for scrollview status here
if decelerate{
self.scrollView.setContentOffset(self.scrollView.contentOffset, animated:false) // this will force stop the scrolling so that Drawable view can be added to pages
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.