Reference: Apple's official website article Understanding Auto Layout
Summarize
- Adding constraints does not take effect immediately, it will be loaded
Autolayout (Masonry)
at the right timeFrame
, and the value read at this time is still the previous value Autolayout (Masonry)
After the constraint is added and modified, it will be modifiedFrame
at the right timeFrame
, causing the modification behavior to become invalid- means setting
Frame
andAutolayout (Masonry)
constraining at the same time, what ends up on the screen is what the constraints are supposed to look like, it's worth reminding that changingFrame
doesn't changeAutolayout (Masonry)
the constraints
suitable time
- Of course, in addition to these, you can also manually call refresh
AutoLayout Constraints Auto Layout
The layout system of the view is determined by a series of linear equations ( Cassowary
layout algorithm), each constraint can be regarded as a representation of an equation, AutoLayout
and the performance bottleneck is the efficiency of Cassowary
solving multiple equations