Created
June 6, 2014 18:43
-
-
Save djburdick/022c3f45172d003930ca to your computer and use it in GitHub Desktop.
Setup UIScrollView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. embed content in uiview (select all and Editor -> Embed In) | |
2. embed that uiview in a uiscrollview | |
3. set uiscrollview size to phone screen size (eg: 320x568) | |
4. set uiview size to the size of the entire contest (eg: 320x900) | |
5. create property outlets for both uiview and uiscrollview | |
6. set the scrollview content size to the uiview size. self.scrollView.contentSize = self.contentView.bounds.size; | |
7. make sure the contentSize code is in - (void)viewDidAppear:(BOOL)animated (not in viewDidLoad) | |
or if in a navigation controller it must be in: viewDidLayoutSubviews |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment