How can I set the scrolling position of an UIScrollView?
-
06-07-2019 - |
Question
I've seen the setContentOffset:animated: method. Is that going to scroll to a specific position, or what does that "offset" mean?
Solution
Yes. From the Apple documentation:
setContentOffset:animated:
Sets the offset from the content view’s origin that corresponds to the receiver’s origin.
OTHER TIPS
You can control the animation using
[UIView animateWithDuration:1.2 animations:^{_scrollView.contentOffset = CGPointMake(X, Y);}];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow