0
我试图更改UIBezierPath的颜色,以便从Internet复制一些可靠的代码,但是出现了一个我似乎无法理解的错误。以下是代码和错误。请帮忙。在Swift中更改UIBezierPath的颜色
override func draw(_ rect: CGRect) {
let skullRadius = min(bounds.width, bounds.height)
let skullCenter = CGPoint(x: bounds.midX, y: bounds.midY)
let skull = UIBezierPath(arcCenter: skullCenter, radius: skullRadius, startAngle: 0.0, endAngle: CGFloat(2*M_PI), clockwise: false)
skull.lineWidth = 3
UIColor.blueColor().setFill()
skull.stroke()
}
如果您使用的是快速的3/8的Xcode然后试试这个,UIColor.blue.setFill() – Blahji