Which is better to use if I simply want a background image for a UIView
? I can accomplish this with either method, but which is more efficient? My hunch is that using a UIView
with colorWithPaternImage
is more efficient than using a UIImageView
. I'll be using this for each row in a UITableView
. Thanks! Matt
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
Completely disagree with boreas. There can be significant differences using
colorWithPatternImage
vs other strategies depending on your requirements. For example, if you are using aUIScrollView
, usingcolorWithPatternImage
won't allow the image to scroll. It also generally depends on how large your view is because there is some tradeoff in performance vs memory footprint for different tiling strategies.Check out WWDC 2010 session 104 which discusses tiling performance using
CATiledLayer
. This is a good high-performance alternative to using either the built-incolorWithPatternImage
orCGContextDrawTiledImage
.If your requirement is simply to display a single 320x480 static image, then there won't be any significant differences in the various strategies, but if your requirements are more complex then there certainly are.
Yes, there is a
UIView
there anyway, so why bothering with anotherUIImageView
?