Here is a scroll view guide from Apple
The basic steps are:
- Create a
UIScrollView
and a content view you want to put inside (in your case aUIImageView
). - Make the content view a subview of the scroll view.
- Set the content size of the scrollview to the frame size of the content view. This is a very important step that people often omit.
- Put the scroll view in a window somewhere.
As for the paging behavior, check out UIScrollView’s pagingEnabled
property. If you need to scroll by less than a whole page you’ll need to play tricks with clipsToBounds
, sort of the reverse of what is happening in this StackOverflow question.