【发布时间】:2015-12-03 15:17:52
【问题描述】:
我想为我的 UIView 添加边框,只有左下角半径。我正在使用以下代码来实现所需的结果,但正在工作我是 swift 的新手
var layer = CAShapeLayer()
layer.bounds = self.myView.bounds
layer.borderColor = UIColor.whiteColor().CGColor
layer.borderWidth = 2
callayer.path = UIBezierPath(roundedRect: self.imgView.bounds, byRoundingCorners: [.BottomRight], cornerRadii: CGSize(width: 20, height: 20)).CGPath
self.myView.layer.mask = layer
结果
我是 swift 新手。我的 UIView 如何才能同时拥有一个圆角半径和边框?
【问题讨论】: