I am loading a number of UIViews onto a UIScrollView and am trying to track down why they are using so much memory. After a process of elimination using Instruments I have discovered that setting the background colour of the views increases memory usage by 4 times.
If I don't set the background colour the memory usage sits at around 4.5megs. As soon as I set the background colour to anything redColor or clearColor the memory usage jumps to 17megs.
Here is the code:
ThumbnailView *thumbView = [[ThumbnailView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 225.0f, 320.0f)];
thumbView.tag = aCounter;
thumbView.backgroundColor = [UIColor clearColor];
Does anyone know what could be causing this?
What I am really after is to have the background clear. If there is no way around this, is there another way of setting the background of a UIView to be clear?