Created
August 23, 2013 13:54
-
-
Save jeffbailey/6319569 to your computer and use it in GitHub Desktop.
AutoLayout example of centering a view horizontally.
Refer to:
http://stackoverflow.com/questions/12873372/centering-a-view-in-its-superview-using-visual-format-language
This file contains 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
[NSLayoutConstraint constraintWithItem:view | |
attribute:NSLayoutAttributeCenterX | |
relatedBy:NSLayoutRelationEqual | |
toItem:view.superview | |
attribute:NSLayoutAttributeCenterX | |
multiplier:1.f constant:0.f]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment