@H_403_1@SnapKit:
@H_403_1@https://github.com/SnapKit/SnapKit
@H_403_1@
@H_403_1@v.snp_makeConstraints@H_403_1@{ (make)in
由于swift和oc语法不一样 equalTo(self.view)是传入参数
make.top.equalTo(self.view).offset(100)
make.left.equalTo(self.view).offset(100)
make.right.equalTo(self.view).offset(-100)
make.bottom.equalTo(self.view).offset(-100)
}
Masonry:
https://github.com/SnapKit/Masonry
由于swift和oc语法不一样 equalTo()是先调用get方法
v.mas_makeConstraints{ (make)in
make.top.equalTo()(self.view).setOffset(100)
make.left.equalTo()(self.view).setOffset(100)
make.right.equalTo()(self.view).setOffset(100)
make.bottom.equalTo()(self.view).setOffset(100)
}