swift这种参数怎么传

2022-02-16  本文已影响0人  陈藩

源代码:

public /*not inherited*/ init(roundedRect rect: CGRect, cornerWidth: CGFloat, cornerHeight: CGFloat, transform: UnsafePointer<CGAffineTransform>?)

传参数的代码:

 let path3 = CGPath.init(roundedRect: CGRect.init(x:100, y: 200, width: 200, height: 200), cornerWidth: 100, cornerHeight:100, transform:[CGAffineTransform(translationX:-100, y:100)])
    context.setFillColor(UIColor.red.cgColor)
    context.addPath(path3)
    context.fillPath()
上一篇 下一篇

猜你喜欢

热点阅读