4
我想以此来仅绘制圆角,你可以在我的截图中看到(图C)绘制差异
这里是绘制2 UIBezierPath(见截图)之间的差异我代码:
let context = UIGraphicsGetCurrentContext()
CGContextSaveGState(context)
let rectanglePath = UIBezierPath(rect: rect)
CGContextAddPath(context, rectanglePath.CGPath)
CGContextEOClip(context)
let roundedRectanglePath = UIBezierPath(roundedRect: productRect, byRoundingCorners: roundedCorners, cornerRadii: CGSize(width: 6, height: 6))
CGContextAddPath(context, roundedRectanglePath.CGPath)
CGContextFillPath(context)
CGContextRestoreGState(context)
不幸的是,它不起作用。我只画圆形的黑色矩形。
你有什么想法吗?
非常感谢。
这是完美的!非常感谢Rob。 – thierryb