Search code examples
iosuiimageviewdrawingcalayer

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


Solution

  • 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.