【发布时间】:2012-09-18 20:10:32
【问题描述】:
我的一些应用程序使用自定义图像作为背景。检查屏幕尺寸以放置正确图像的正确方法是什么?
在 viewDidLoad 中应该是这样的:
if ([UIScreen mainScreen] == 2.0)
{
UIImage * backgroundImage = [UIImage imageNamed:@"bgimage-568h@2x.png"];
backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage]];
}
else
{
UIImage * backgroundImage = [UIImage imageNamed:@"bgimage.png"];
backgroundImageView = [[UIImageView alloc] iniWithImage:backgroundImage]];
}
非常感谢任何提示/建议!
谢谢!
【问题讨论】:
标签: objective-c uiimageview uiimage ios6 iphone-5