我有一个 ipad 应用程序(>30 个视图/页面)每个视图都有一个独特的背景。
问题:设置背景的最佳方法是什么(内存友好)
有没有比添加:uiimageview“backgroundView”作为子视图更好的方法?
版本1:
[[UIImage alloc] initWithData:imageData];
视网膜开关似乎有问题
版本2:
self.layer.contents = (id)image.CGImage;
第 3 版:
UIImage* image = [UIImage imageWithContentsOfFile:fileLocation];
版本 2 似乎工作正常。也许有人告诉我什么是最好的方法,为什么;)
谢谢亚历克斯