【问题标题】:CGpathaddrect in swift 3swift 3中的CGpathaddrect
【发布时间】:2018-02-23 20:58:35
【问题描述】:

我正在转换为 swift 3,但我不确定我所做的是否正确。

旧代码:

CGPathAddRect(innerShadowPath, nil, bubblePath.boundingBoxOfPath.insetBy(dx: -30, dy: -30))

swift 3 的新代码:

innerShadowPath.addPath(bubblePath.boundingBoxOfPath.insetBy(dx: -30, dy: -30) as! CGPath)

非常感谢您的帮助。谢谢。

【问题讨论】:

    标签: swift swift3 core-graphics


    【解决方案1】:

    CGPathAddRect 应该翻译成addRect,而不是addPath

    innerShadowPath.addRect(bubblePath.boundingBoxOfPath.insetBy(dx: -30, dy: -30))
    

    【讨论】:

      猜你喜欢
      • 2017-01-18
      • 2017-07-26
      • 2017-04-02
      • 2017-02-13
      • 2017-04-09
      • 2016-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多