我正在使用 UIBezierPath
绘制形状,但我的 Arc 有问题,我向您展示我的代码:
...
rightUpPath.move(to: CGPoint(x: 0, y: height/2))
rightUpPath.addArc(withCenter: CGPoint(x: cornerRadiusView, y: height - cornerRadiusView),
radius: cornerRadiusView,
startAngle: .pi,
endAngle: (.pi * 2) / 3,
clockwise: false)
rightUpPath.addLine(to: CGPoint(x: self.bounds.size.width - cornerRadiusView, y: height))
...
考虑到高度等于 40,cornerRadiusView = 10。圆弧的底部通常等于形状的底部,但这向我展示了这一点:
我希望弧的底部等于灰色形状的高度,有人可以告诉我哪里做错了吗?
最佳答案
好吧,我的问题非常愚蠢:
我更改了我的 endAngle: (.pi * 2)/3
到 endAngle: .pi/2
...
关于ios - UIBezierPath 视觉错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51326215/