Skip to content

Instantly share code, notes, and snippets.

@abi
Created February 16, 2010 08:22
Show Gist options
  • Save abi/305391 to your computer and use it in GitHub Desktop.
Save abi/305391 to your computer and use it in GitHub Desktop.
//Photo1.jpg is in the Resources folder
CGRect frame = CGRectMake(0, 0, 200, 200);
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:frame];
frame = CGRectMake(0, 0, 500, 500);
UIImageView *myImageView = [[UIImageView alloc] initWithFrame:frame];
[myImageView setImage:[UIImage imageNamed:@"photo1.jpg"]];
[scrollView addSubview:myImageView];
scrollView.contentSize = CGSizeMake(500, 500);
[mainView addSubview:scrollView];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment