pod 'Masonry' 自动布局

//redView和父视图左边距10

    [redView mas_makeConstraints:^(MASConstraintMaker *make) {

        make.leading.equalTo(self.view.mas_leading).offset(10);

        make.top.equalTo(self.view.mas_top).offset(30);

        make.width.equalTo(blueView.mas_width).offset(0);

        make.height.equalTo(@150);

    }];

原文地址:https://www.cnblogs.com/yangqinglong/p/5363664.html