layer.cornerRadius
layer.borderWidth
layer.borderUIColor
边框颜色要写extension
@IBDesignable extension CALayer {
@IBInspectable var borderUIColor: UIColor {
get {
return UIColor(cgColor: self.borderColor!)
}
set {
self.borderColor = newValue.cgColor
}
}
}
网友评论