/*

/**

 * 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

相关文章:

  • 2021-12-20
  • 2021-06-09
  • 2022-12-23
  • 2022-01-10
  • 2021-06-19
  • 2022-01-14
猜你喜欢
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-08-02
  • 1970-01-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案