Я хотел бы удалить «синий» круг и просто иметь «полый» центр (так что есть только красный слой, и вы можете видеть фон внутри).Заполнение внутри цветом clear
не работает.
class AddButtonView: UIView {
override func draw(_ rect: CGRect) {
super.draw(rect)
// Outer circle
UIColor.red.setFill()
let outerPath = UIBezierPath(ovalIn: rect)
outerPath.fill()
// Center circle
UIColor.blue.setFill()
let centerRect = rect.insetBy(dx: rect.width * 0.55 / 2, dy: rect.height * 0.55 / 2)
let centerPath = UIBezierPath(ovalIn: centerRect)
centerPath.fill()
}
}
Как я могу это сделать?intersects
ничего не делал.
![enter image description here](https://i.stack.imgur.com/ajaq7.jpg)