当我用
设置UIView的背景图像时[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"mainScreenBackground" ofType:@"png"]]]];
需要6 MB的内存。 我想要另一种占用更少内存的方式。
答案 0 :(得分:0)
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];
这有用吗?