24

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

Thanks
  • 39,609
  • 71
  • 204
  • 317

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
  • 262,936
  • 84
  • 758
  • 1,028
Rog
  • 16,936
  • 9
  • 49
  • 73
4

You can control the animation using

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