首页 > 其他 > 详细

PureLayout(轻量级自动布局)

时间:2016-05-08 16:35:39      阅读:166      评论:0      收藏:0      [点我收藏+]

直接整理用法

1.设置高度宽度

[view1 autoSetDimension:ALDimensionHeight toSize:70.0];

[view1 autoSetDimension:ALDimensionWidth toSize:70.0];

2.相对于父视图

ALEdgeInsets defInsets = ALEdgeInsetsMake(20.0,20.0,20.0,20.0);

[view1 autoPinEdgesToSuperviewEdgesWithInsets:defInsets];

相当于下面的写法

[view1 autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:20.0];

[view1 autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:20.0];

[view1 autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:20.0];

[view1 autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:20.0];

相对于父视图除了某一个

[view1 autoPinEdgesToSuperviewEdgesWithInsets:defInsets excludingEdge:ALEdgeBottom];

3.两个视图的相对位置

[view2 autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:view1 withOffset:defInsets.bottom];

PureLayout(轻量级自动布局)

原文:http://www.cnblogs.com/huoran1120/p/5470807.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!