【发布时间】:2018-05-25 14:53:12
【问题描述】:
我想在 UIView 的边框上设置左下角和右下角的圆角半径。这是代码。 **问题是它不在 1.5 边框中显示 SHARP **
class BorderView: UIView {
override func draw(_ rect: CGRect) {
let color = UIColor.red
let color2 = UIColor.brown
//// Rectangle Drawing
let rectanglePath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: 200, height: 200), byRoundingCorners: [.bottomRight, .bottomLeft], cornerRadii: CGSize(width: 10, height: 10))
rectanglePath.close()
color2.setFill()
rectanglePath.fill()
color.set()
rectanglePath.lineWidth = 1.5
rectanglePath.stroke()
}
}
输出
预期输出
【问题讨论】:
-
“尖锐”是指“平滑”还是“尖锐”?
-
您是否尝试过使用不是分数的线宽?所以要么
1要么2 -
嘿@rmaddy 我想要“顺利”
标签: swift uiview border layer cornerradius