"AutoLayout Animation"
For storyboard Each constraint, you can create a connection to the code by dragging the line like a control.
A constraint is an object through which the constant property of the object can modify the number of points of the constraint.
After the modification, the animation effect can be achieved by invoking the [Self.view layoutifneeded] method within the block of the UIView's Animatewithduration:: Method, which adjusts all the child views when the layoutifneeded is called.
Self.redViewtopConstraint.constant + = 100; [UIView animatewithduration:0.5 animations:^{ [Self.view layoutifneeded];//Let all subclass constraints perform animation}];
"Label Auto Adjust"
The width of the label is determined by the content, so you only need to add the X, y constraints.
Once the correct constraints are added, the label automatically adjusts the dimensions to the content, eliminating the need to calculate
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
(89) using AutoLayout to animate and label automatically adjusts to content