Masonry 设置宽高比例

/*

/**

 * Sets the NSLayoutConstraint multiplier property

 */

- (MASConstraint * (^)(CGFloat multiplier))multipliedBy;

/**

 * Sets the NSLayoutConstraint multiplier to 1.0/dividedBy

 */

- (MASConstraint * (^)(CGFloat divider))dividedBy;


*/

multipler属性表示约束值为约束对象的乘因数, dividedBy属性表示约束值为约束对象的除因数,可用于设置view的宽高比

这两个属性可以设置视图中的宽高比例

 上代码。。

    [aview makeConstraints:^(MASConstraintMaker *make) {

        make.left.mas_equalTo(self.view);

        make.bottom.mas_equalTo(self.view);

        make.right.mas_equalTo(WeSelf.InputYuYinbtn.left);

        make.height.mas_equalTo(aview.width).multipliedBy(0.6);// 高/宽 == 0.6

    }];

参考链接:http://www.jianshu.com/p/1d1a1165bb04

原文地址:https://www.cnblogs.com/Jackie-subDai/p/9353547.html