开发者

Can we control the speed of the Scrollview

开发者 https://www.devze.com 2023-03-12 17:27 出处:网络
I have a scroll view (shown in the picture below).It allows the user to jump/navigate between various sections in my ap开发者_开发知识库p. The number of sections varies between 20 to 40 (which is pret

I have a scroll view (shown in the picture below). It allows the user to jump/navigate between various sections in my ap开发者_开发知识库p. The number of sections varies between 20 to 40 (which is pretty large). The speed of the scroll should depend on the speed with which the user swipes/scrolls on the view. I thought of doing this operation by using the contentOffSet property of scrollview, but didn't do it as it might decrease the usability of this feature.

Can we control the speed of the Scrollview

-------> This is the scroll view

1-How can I control the speed of the scroll view?

2-Can I do this operation with out the help of content offset property?


I would recommend using UIPanGestureRecognizer on your custom view and use velocityInView:

If that doesn't cut your need, do your own customized calculation by listening to UIGestureRecognizerStateChanged

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号