1.//Add this macro, you do not have to take the Mas_ prefix
#define Mas_shorthand
Add this macro, Equalto is equal to Mas_equalto
#define Mas_shoryhand_globals
This header file must be placed behind the top two macros
#import "Masonry.h"
[_label1mas_makeconstraints: ^ (masconstraintmaker *make) {
Make. top. Equalto(_contentview1. Mas_top). with. Offset(ten);
Make. left. Equalto(_contentview1. Mas_left). with. Offset(5);
Make. height. Equalto(@50);
}];
[_label2 mas_makeconstraints: ^ (masconstraintmaker *make) {
Make. left. Equalto(_label1. Mas_right). with. Offset(5);
Make. top. Equalto(_contentview1. Mas_top). with. Offset(ten);
// the right interval remains greater than or equal to 5
Make. right. Lessthanorequalto(_contentview1. Mas_right). with. Offset( -5);
Make. height. Equalto(@50);
}];
2.Masequalto and Equalto differences: masequalto more than Equalto type conversion operations, generally speaking, most of the time two methods are common, but for numeric elements use Mas_equalto.
For the handling of objects or multiple properties, use Equalto. In particular, multiple attributes must be used Equalto, such as Make.left.and.right.equalTo (Self.view);
3.setcontenthuggingpriority Understanding as constraint precedence
Setcontentcompressionresistancepriority understood as content priority
These two are set the priority between content and constraints, if the constraint is high priority, when the view is not enough, the content will be compressed, and conversely, constrained compression
Use of Masonry