Swift2 在swift 2.0中添加全边框和仅右下角短号半径
我想在我的UIView中添加只有左下角半径的边框。我正在使用以下代码来实现所需的结果,但正在工作,我是swift的新手Swift2 在swift 2.0中添加全边框和仅右下角短号半径,swift2,ios9,xcode7,Swift2,Ios9,Xcode7,我想在我的UIView中添加只有左下角半径的边框。我正在使用以下代码来实现所需的结果,但正在工作,我是swift的新手 var layer = CAShapeLayer() layer.bounds = self.myView.bounds layer.borderColor = UIColor.whiteColor().CGColor layer.borderWidth = 2 callayer.path = UIBezierPath(roundedRect
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
结果
我不熟悉斯威夫特。我怎样才能同时拥有我的UIView的一个corder半径和边界
self.myView.layer.borderWidth = 2.0
self.myView.layer.borderColor = UIColor.whiteColor().CGColor
self.myView.layer.cornerRadius = /*floatvalue*/
或者你想要一个圆形视图
self.myView.layer.cornerRadius = self.myView.frame.size.width/2