SnapKit代码约束

        let label = UILabel()
label.frame = CGRectMake(, , , )
label.backgroundColor = UIColor.cyanColor()
label.text = "SnapKit"
label.textAlignment = NSTextAlignment.Center
self.view.addSubview(label)
label.snp_makeConstraints { (make) in make.height.width.equalTo()
make.top.equalTo(self.view.snp_top).offset()
make.centerX.equalTo(self.view.snp_centerX)
}
let label1 = UILabel()
label1.frame = CGRectMake(, , , )
label1.backgroundColor = UIColor.cyanColor()
label1.text = "SnapKit"
label1.textAlignment = NSTextAlignment.Center
self.view.addSubview(label1)
label1.snp_makeConstraints { (make) in make.height.width.equalTo()
make.top.equalTo(label.snp_bottom).offset()
make.centerX.equalTo(self.view.snp_centerX)
}

SnapKit代码约束

上一篇:vue scoped 穿透_vue 修改内部组件样式问题


下一篇:KVM虚拟化技术