【问题标题】:UIBezierPath visual error?UIBezierPath 视觉错误?
【发布时间】:2018-07-13 13:25:52
【问题描述】:

我正在用 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。弧的底部通常等于形状的底部,但这告诉我:

我希望弧的底部等于灰色形状的高度,有人可以告诉我哪里做错了吗?

【问题讨论】:

    标签: ios iphone swift xcode uibezierpath


    【解决方案1】:

    好吧,我的问题很愚蠢:

    我改变了我的endAngle: (.pi * 2) / 3endAngle: .pi / 2

    ...

    【讨论】:

      猜你喜欢
      • 2017-03-06
      • 2014-04-30
      • 1970-01-01
      • 2018-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-17
      • 2018-07-07
      相关资源
      最近更新 更多