2013-04-08 86 views
0

我是全新的iOS我正在开发与iPhone 5兼容的应用程序我也想申请背景图片来查看我的问题是我应该需要两种不同尺寸的图像?????iphone 5视网膜显示屏

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) 
{ 
    CGSize result = [[UIScreen mainScreen] bounds].size; 
    if(result.height == 480) 
    { 
     // iPhone 4S background view 
    } 
    if(result.height == 568) 
    { 
     // iPhone background image 

    } 
} 
+0

那么通常你不这样做手动,但让操作系统做的工作 - 见http://stackoverflow.com/questions/9611061/how-to-support-both-ipad-and-iphone-retina-graphics-在万能-应用 – 2013-04-08 10:34:14

回答

3

说你background.png为应用背景,现在支持视网膜显示设备上,你应该有background.png的,将在被添加为[email protected]一个确切的两倍大小的项目文件夹。正常或视网膜图像的选择将由iOS自己根据您的设备来处理!

好,现在对于iPhone 5装置,其高度不等同于iPhone 3G,4,4S需要的640(宽)×1136(高)background.png,如iPhone 5 仅支持视网膜图像。为此,您需要包含[email protected]以区别于其他文件。

初始屏幕的一个例子,

为Default.png ---普通设备,iPhone 3G

[email protected] ---视网膜设备,> iPhone 3G

[email protected] ---仅限视网膜装置,> iPhone 4S

它会自动选择特定的启动画面!