【发布时间】:2012-05-14 13:24:41
【问题描述】:
我有一个 ipad 应用程序(>30 个视图/页面)每个视图都有一个独特的背景。
问题: 设置背景的最佳方法是什么(内存友好)
有没有比添加:uiimageview "backgroundView" 作为子视图更好的方法?
版本1:
[[UIImage alloc] initWithData:imageData];
视网膜开关似乎有问题
版本2:
self.layer.contents = (id)image.CGImage;
版本 3:
UIImage* image = [UIImage imageWithContentsOfFile:fileLocation];
版本 2 似乎工作正常。也许有人告诉我什么是最好的方法,以及为什么;)
谢谢 亚历克斯
【问题讨论】:
标签: objective-c memory-leaks background-image memory-warning