Skip to content

Instantly share code, notes, and snippets.

@pratikshabhisikar
Created September 12, 2011 12:09
Show Gist options
  • Save pratikshabhisikar/1211117 to your computer and use it in GitHub Desktop.
Save pratikshabhisikar/1211117 to your computer and use it in GitHub Desktop.
loadView example
- (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