ColorWithPatternImage Vs. UIImageView

What is better to use if I just want a background image for a UIView ? I can accomplish this using any method, but which one is more efficient? My guess is that using a UIView with colorWithPaternImage more efficient than using a UIImageView . I will use this for every row in a UITableView . Thank you Matt

+7
objective-c iphone background-image uiimageview
source share
2 answers

I completely disagree with borea. There may be significant differences using colorWithPatternImage versus other strategies depending on your requirements. For example, if you use UIScrollView , using colorWithPatternImage will not allow the image to scroll. It also generally depends on how big your point of view is, because there is some compromise between performance and memory for different tile strategies.

Check out the WWDC 2010 session 104 , which discusses tile performance using CATiledLayer . This is a good high-performance alternative to using the built-in colorWithPatternImage or CGContextDrawTiledImage .

If your requirement is to simply show one 320x480 static image, then there will be no significant differences in the different strategies, but if your requirements are more complex, then of course there are.

+15
source share

Yes, there is a UIView , so why bother with another UIImageView ?

+1
source share

All Articles