Created
September 12, 2011 12:09
-
-
Save pratikshabhisikar/1211117 to your computer and use it in GitHub Desktop.
loadView example
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
| - (void)loadView { | |
| // Create the root view. | |
| UIView *rootView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; | |
| // Create the scroll view. | |
| UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)]; | |
| // Set the content size of scroll view. | |
| scrollView.contentSize = CGSizeMake(320 , 768); // This is expected to scroll horizontally. | |
| // Add scroll view to root view. | |
| [rootView addSubview:scrollView]; | |
| [scrollView release]; | |
| // Set the root view. | |
| self.view = rootView; | |
| [rootView release]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment