开发者

How do I draw an angle gradient using CALayer or CoreGraphics functions? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

CGContextDrawAngleGradient?

HI I want to dr开发者_如何学Goaw a gradient like the one below in a UIView or CALayer using Quartz2D or CoreGraphics methods.

Does anyone know how can I achieve that?

Any snippet would be great.

Thank you!

How do I draw an angle gradient using CALayer or CoreGraphics functions? [duplicate]


Unfortunately, Core Graphics and Quartz only support axial (linear) and radial (circular) gradients. For an angle gradient you’ll either have to draw it manually (perhaps by drawing triangles in a circle at a resolution fine enough for the color shifts to be unnoticeable) or have a precomposed angle-gradient image that you resize and clip to your drawing needs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜