lazy var bgView: UIView = {
let view = UIView ()
view.backgroundColor = UIColor.white
return view
}()
bgView.snp.makeConstraints { (make) -> Void in
make.width.equalTo(50)
make.height.equalTo(50)
make.center.equalTo(self.view)
}
线
lineView.snp.makeConstraints { (make) -> Void in
make.left.equalTo(self.contentView);
make.right.equalTo(self.contentView);
make.bottom.equalTo(self.descLable.top);
make.height.equalTo(1);
}
顶部圆角
let bgView = UIView ()
bgView.frame = CGRect.init(x: 50, y: 80, width: 100, height: 100)
bgView.backgroundColor = UIColor.gray
self.view.addSubview(bgView)
let maskPath = UIBezierPath.init(roundedRect: view.bounds, byRoundingCorners: .topLeft , cornerRadii: CGSize(width: 10, height: 10))
let maskLayer = CAShapeLayer.init()
maskLayer.frame = view.bounds
maskLayer.path = maskPath.cgPath
bgView.layer.mask = maskLayer
网友评论