ios 中autolayout multipli属性的设置

方法一:用三方的框架masonry       

    [self.loginBtnmas_makeConstraints:^(MASConstraintMaker *make) {

       

        make.width.equalTo(self.view.mas_width).multipliedBy(0.3);

        make.height.equalTo(@30);

        make.centerX.equalTo(self.view.mas_centerX);

        make.top.equalTo(self.view.mas_bottom).multipliedBy(0.7);

    }];

设置一个button在view的0.7处,,

不能写成:

        make.top.equalTo(self.view.mas_height).multipliedBy(0.7);

会报错   。。


方法二:

如果用storyboard可以这样:
1.把imageview的顶部拖到与superview的bottom齐平。
2.改变Align Center Y的Mutiplier,1改为4,即为superview的1/4处。



引用他人的一个说法

你可以这样理解,imageView.top = self.view.bottom*1 就是:

                   |
  self.view.bottom |  
      v            |
------------------(1)
      ^            |
  imageView.top    |
                   
imageView.top = self.view.bottom*0.25,就是在上面的基础上乘以0.25,就是:
------------ > (self.view.top)
(self.view)
------------ > self.view.bottom * 0.25
     ^
imageView.top

------------ > self.view.bottom * 1




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值