简体   繁体   中英

UIView background - colorWithPatterOfImage or UIImageView?

I'm wondering, what're the differences or, more importantly, what's better for performance - for a very fast redrawing:

1) myView/myLayer.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"myImage.png"]]; for about 40 to 90 views/layers

or

Just using about 40 to 90 UIImageViews ?

What's better for fast redrawing and what's going under the hood, so I can understand which one to pick?

Thanks

This previous post might help: colorWithPatternImage Vs. UIImageView

As well as this: http://cocoaintheshell.com/2011/01/colorwithpatternimage-memory-usage/

Consensus seems to be that colorWithPatternImage uses a lot of memory and to use UIImageView.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM