Last active
December 27, 2015 04:29
-
-
Save sebk/7267649 to your computer and use it in GitHub Desktop.
Change the size of a UIView with autolayout programmatically
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
//_constraintHeight and _constraintWidht are IBOutlet NSLayoutConstraints (from _theView), defined in xib | |
_constraintHeight.constant = NEW_HEIGHT; | |
_constraintWidth.constant = NEW_WIDTH; | |
[_theView setNeedsUpdateConstraints]; | |
[UIView animateWithDuration:((animated) ? ANIMATION_DURATION : 0.0) animations:^{ | |
[_theView layoutIfNeeded]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment