add UI/NSLayoutGuide support like UIView #585
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add layoutGuide support equalToSuperview & greaterThanOrEqualToSuperview & lessThanOrEqualToSuperview
MAS_VIEW * contentView = MAS_VIEW.new; contentView.backgroundColor = self.randomColor; contentView.layer.borderColor = self.randomColor.CGColor; contentView.layer.borderWidth = 2 ; [self addSubview:contentView]; MAS_VIEW * leftView = MAS_VIEW.new; leftView.backgroundColor = self.randomColor; leftView.layer.borderColor = self.randomColor.CGColor; leftView.layer.borderWidth = 2 ; [contentView addSubview:leftView]; MAS_VIEW * rightView = MAS_VIEW.new; rightView.backgroundColor = self.randomColor; rightView.layer.borderColor = self.randomColor.CGColor; rightView.layer.borderWidth = 2 ; [contentView addSubview:rightView]; [contentView mas_makeConstraints:^(MASConstraintMaker * make){ make.left.right.top.equalToSuperview(); make.height.mas_equalTo(self.mas_height).multipliedBy(0.3); }]; MAS_LAYOUT_GUIDE *layout= [MAS_LAYOUT_GUIDE mas_allocWithOwningView:contentView]; [layout mas_makeConstraints:^(MASConstraintMaker * _Nonnull make){ make.center.equalToSuperview(); make.size.mas_equalTo(CGSizeMake(60,60)); }]; [leftView makeConstraints:^(MASConstraintMaker * make){ make.top.mas_equalTo(layout); make.right.mas_equalTo(layout.mas_left); make.bottom.mas_equalTo(layout); make.width.mas_equalTo(layout.mas_width); }]; [rightView makeConstraints:^(MASConstraintMaker * make){ make.top.mas_equalTo(layout); make.left.mas_equalTo(layout.mas_right); make.bottom.mas_equalTo(layout); make.width.mas_equalTo(layout.mas_width); }];