码迷,mamicode.com
首页 > 其他好文 > 详细

masonry

时间:2017-03-26 23:29:58      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:make   nts   const   ons   更新   update   insets   and   top   

UIView *myView = nil

[self.window addSubview:myView];

//使用之前要先将试图添加到俯视图上 然后再约束 

[myView mas_makeConstraints:^(MASConstraintMaker *make){

  make.center.equalTo(self.window);

  make.size.mas_equalTo(CGSizeMake(300, 300));

}];

mas_makeConstraints 新增约束

mas_updateConstraints 更新

mas_remakeConstraints 移除

mas_equalTo  :NSNumber CGPoint CGSize UIEdgeInsets

[myView mas_makeConstraints:^(MASConstraintMaker *make){

  make.top.left.bottom.and.right.equalTo(self.window).with.insets(UIEdgeInsetsMake(10,10,10,10));

}];

[myView mas_makeConstraints:^(MASConstraintMaker *make){

  make.edges.equalTo(self.window).with.insets(UIEdgeInsetsMake(10,10,10,10));

}];

[myView mas_makeConstraints:^(MASConstraintMaker *make){

  make.top.equalTo(self.window).with.offset(15);

  make.left.equalTo(self.window).with.offset(15);

  make.bottom.equalTo(self.window).with.offset(-15);

  make.right.equalTo(self.window).with.offset(-15);

 

}];

masonry

标签:make   nts   const   ons   更新   update   insets   and   top   

原文地址:http://www.cnblogs.com/dlwj/p/6624698.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!