是否有任何其他方法来设置背景图像以减少内存

时间:2012-04-27 09:07:43

标签: ipad

当我用

设置UIView的背景图像时
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"mainScreenBackground" ofType:@"png"]]]];

需要6 MB的内存。 我想要另一种占用更少内存的方式。

1 个答案:

答案 0 :(得分:0)

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

这有用吗?