SmallAutoLayout
公告
1.视图的 translatesAutoresizingMaskIntoConstraints 属性由使用者决定。SmallAutoLayout 不会处理该属性,原因是可能存在与 frame 配合的情况。
2.特殊的标记 safeAreaGuide$ topGuide$ bottomGuide$ 必须最先设置
示例
要运行示例项目,请克隆存储库,并首先从 Example 目录中运行 pod install
。
view0.width == view1.width
(狗娘养的API)fuck
[NSLayoutConstraint constraintWithItem:view0 attribute:(NSLayoutAttributeWidth) relatedBy:(NSLayoutRelationEqual) toItem:view1 attribute:(NSLayoutAttributeNotAnAttribute) multiplier:1.0 constant:0.0];
yeah
[view0.width$ equalTo:view1.width$];
view0.width == view1.width + 10
(狗娘养的API)fuck
[NSLayoutConstraint constraintWithItem:view0. attribute:(NSLayoutAttributeWidth) relatedBy:(NSLayoutRelationEqual) toItem:view1 attribute:(NSLayoutAttributeNotAnAttribute) multiplier:1.0 constant:10];
yeah
[view0.width$ equalTo:view1.width$ trim:10];
view0.left == self.view.safeArea.left
(狗娘养的API)fuck
[NSLayoutConstraint constraintWithItem:view0 attribute:(NSLayoutAttributeLeft) relatedBy:(NSLayoutRelationEqual) toItem:self.view.safeAreaLayoutGuide attribute:(NSLayoutAttributeLeft) multiplier:1.0 constant:0.0];
yeah
[view0.left$ equalTo:self.view.safeAreaGuide$.left$];
view0.top == self.topLayoutGuide.bottom
(狗娘养的API)fuck
[NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:(NSLayoutAttributeBottom) relatedBy:(NSLayoutRelationEqual) toItem:view0 attribute:(NSLayoutAttributeTop) multiplier:1.0 constant:0.0];
yeah
[view0.top$ equalTo:self.topGudie$.bottom$];
需求
安装
SmallAutoLayout可通过CocoaPods获取。为了安装,只需将以下行添加到您的Podfile中
pod 'SmallAutoLayout'
作者
背叛誓言,[email protected]
许可证
SmallAutoLayout采用MIT许可证。查看LICENSE文件获取更多信息。