Last active
December 10, 2015 08:38
-
-
Save psobko/4409296 to your computer and use it in GitHub Desktop.
UIView Positioning
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
//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