0531-autolayout not only can do the screen adaptation can also do the system adaptation uidynamic do physical animation. The effect can be as follows:
AutoLayout
AutoLayout is an "automatic layout" technique designed to lay out UI interfaces. With AutoLayout, please forget frame
AutoLayout is stronger than autoresizing, both incompatible
2 Core concepts of AutoLayout
Implementing AUTOLAYOUT-VFL with Code (Visual Format Language)
The following ideas are implemented:
Nslayoutconstraint's explanation:
Add a UIView to the parent control view and use the Nslayoutconstraint reference constraint to implement:
In order to simplify AutoLayout Apple launched the VFL language
VFL Example 1:
Operation Result:
Note: The inside metrics is used for positioning, just as[NSString StringWithFormat(@"%d", 10)]
As shown in the following:
VFL Example 2:
Operation Result:
Effects of AutoLayout on Uilabel, such as:
AutoLayout do animation
Note: layoutIfNeeded
the method is used for AutoLayout animation. setNeedsDisplay
is the quartz2d brush frames are redrawn DrawInrect:
to draw things on the layer layers of the interface view.
IOS Advanced 21st Day (0531)