標籤:
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];
4.同寬同高
[@[view1,view2]autoMatchViewsDimension:ALDimensionHeight];可以設定多種
[view1 autoMatchDimension:ALDimensionHeight toDimension:ALDimensionHeight ofView:view2];
5.水平對齊垂直對齊
[view1 autoAlignAxis:ALAxisHorizontal toSameAxisOfView:view2];
[view1 autoAlignAxis:ALAxisVertical toSameAxisOfView:view2];
PureLayout的使用