In an iPhone app, is it beneficial to tile a background image that has a pattern in it?
Here's an example of the type of background image I'm talking about, the iPhone Notes app...
(source: icopybot.com)Clearly, there's a pattern in it. My question is, if this were an iPad app and the background image was twice the size, would there be any significant benefits to taking advantage of this pattern by tiling the image? Or would it really make no difference in terms of performance and just be easier to load the entire image into a UIImageView?
Thanks in advan开发者_JAVA百科ce for all your wisdom!
Yes, Apple has stated before that if you can tile, you gain a lot - for one thing, you have a far smaller image in memory so right away you have a large memory win, but then also drawing performance will be faster too.
Even on iPhone, it's tiled. The UIColor class can also be used to create patterns with images. Take a look at the colorWithPatternImage class method.
精彩评论