Skip to content

Instantly share code, notes, and snippets.

@psobko
Last active December 10, 2015 08:38
Show Gist options
  • Save psobko/4409296 to your computer and use it in GitHub Desktop.
Save psobko/4409296 to your computer and use it in GitHub Desktop.
UIView Positioning
//center horizontally or vertically
subView.center = CGPointMake(parentView.frame.size.width / 2, parentView.frame.size.height / 2);
//center horizontally + vertically
subView.center = [parentView convertPoint:parentView.center fromView:parentView.superview];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment