问题描述:

When I set the background image of a UIView with

[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"mainScreenBackground" ofType:@"png"]]]];

it takes 6 mb of memory.

I want another way that takes less memory.

网友答案:
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];

Does this work??

相关阅读:
Top