Gradient texture background
I want to create a dark grill texture that fades to black for a configuration screen under a page curl effect.
Garmin Stree开发者_JAVA百科tPilot Onboard uses something like this: http://www.pcmag.com/slideshow_viewer/0,3253,l%253D286397%2526a%253D286507%2526po%253D7,00.asp?p=n
How do I programmatically create a background such as this? I really don't want to include an image the size of the iPhone screen; this seems the lazy approach.
I would create it in two parts. First, draw a gradient using the normal quartz drawing functions. Then, add an overlay with a repeating pattern of dots. These dots could be a small PNG file that is tiled, or you could use quartz to draw them.
See the documentation for CGContextDrawLinearGradient and [UIColor initWithPatternImage:]
精彩评论