A for Alpha
A for Alpha

Reputation: 2912

Can we control the speed of the Scrollview

I have a scroll view (shown in the picture below). It allows the user to jump/navigate between various sections in my app. 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.

enter image description here-------> 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?

Upvotes: 1

Views: 297

Answers (1)

prakash
prakash

Reputation: 59669

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

Upvotes: 1

Related Questions