masonry remove a single constraint

Today I learned a new trick of masonry:
add/remove a single constraint to the view
1, declare attributes

@property (nonatomic, strong) MASConstraint *label1CentryX;

2. Storage constraints

[_label1 mas_updateConstraints:^(MASConstraintMaker *make) {
        _label1CentryX = make.centerX.equalTo(self).priority(1000);
    }];

3. Add constraints

[_label1CentryX install];

4. Remove constraints

[_label1CentryX uninstall];

Guess you like

Origin blog.csdn.net/qq_28285625/article/details/105122994