Skip to content

Instantly share code, notes, and snippets.

@blixt
Last active August 29, 2015 14:14
Show Gist options
  • Save blixt/adb0ee12197dc87755da to your computer and use it in GitHub Desktop.
Save blixt/adb0ee12197dc87755da to your computer and use it in GitHub Desktop.
// Set up main content area.
UIView *contentView = [[UIView alloc] initWithFrame:scrollView.bounds];
contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
contentView.backgroundColor = [UIColor whiteColor];
[scrollView addSubview:contentView];
self.scrollViewContentView = contentView;
// Put a label in the scroll view content area.
UILabel *label = [[UILabel alloc] initWithFrame:CGRectInset(contentView.bounds, 10, 0)];
label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.scrollViewContentView addSubview:label];
self.scrollViewLabel = label;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment