对于在ViewController内,使用mas_XXXLayoutGuide
对于在View内,推荐使用mas_XXXMargin
如(self为控制器):
[greenView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.mas_bottomLayoutGuide);
make.left.right.equalTo(@0);
make.height.equalTo(@100);
}];
等价于:
[greenView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.view.mas_bottomMargin);
make.left.right.equalTo(@0);
make.height.equalTo(@100);
}];
网友评论