当前位置: 动力学知识库 > 问答 > 编程问答 >

ipad - Is there any other method to set background image to take less memory

问题描述:

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??

分享给朋友:
您可能感兴趣的文章:
随机阅读: