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!
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.
精彩评论