Masonry学习之Array

来源:互联网 发布:室外装修设计软件 编辑:程序博客网 时间:2024/06/01 18:09

这里写图片描述
该例演示一组视图的约束的整体更新。核心代码如下:

- (void)updateConstraints {    [self.buttonViews updateConstraints:^(MASConstraintMaker *make) {        make.baseline.equalTo(self.mas_centerY).with.offset(self.offset);    }];    //according to apple super should be called at end of method    [super updateConstraints];}

对于相同UI行为的一组视图,通过视图数组整体更新其约束,非常方便。

原创粉丝点击