24

I've seen the setContentOffset:animated: method. Is that going to scroll to a specific position, or what does that "offset" mean?

Thanks
  • 40,109
  • 71
  • 208
  • 322

2 Answers2

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
4

You can control the animation using

[UIView animateWithDuration:1.2 animations:^{_scrollView.contentOffset = CGPointMake(X, Y);}];