I've seen the setContentOffset:animated: method. Is that going to scroll to a specific position, or what does that "offset" mean?
Asked
Active
Viewed 3.2k times
2 Answers
41
Yes. From the Apple documentation:
setContentOffset:animated:
Sets the offset from the content view’s origin that corresponds to the receiver’s origin.

Basil Bourque
- 303,325
- 100
- 852
- 1,154

Rog
- 17,070
- 9
- 50
- 73
-
did you set the delegate of ScrollView ? – Ajay Sharma Jun 12 '11 at 08:01
-
Sorry, I mistook contentOffset as contentInset. – macbirdie Jun 12 '11 at 09:38
4
You can control the animation using
[UIView animateWithDuration:1.2 animations:^{_scrollView.contentOffset = CGPointMake(X, Y);}];

Vincent Larroque
- 121
- 6