我正在开发适用于iPhone 5及更低版本的应用程序.
对于图像我正在使用此代码
CGRect mainFrame = [[UIScreen mainScreen] bounds];
int imgIndex = arc4random() % 10 + 1;
if(mainFrame.size.height > 480)
[pBackgroundImageView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"dreams 1136x640 %d.jpg",imgIndex]]];
else
[pBackgroundImageView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"dreams_960x640_%d.jpg",imgIndex]]];
Run Code Online (Sandbox Code Playgroud)
但我对此并不满意.
iphone 5图像有什么特定的命名约定吗?
在此先感谢Mano
我正在开发应用程序以在iphone4和iPhone 5上工作.我使用以下代码来获取屏幕大小
CGRect screenBounds = [[UIScreen mainScreen] bounds];
Run Code Online (Sandbox Code Playgroud)

我正在使用iPhone 5模拟器,但它显示了iPhone 4的屏幕尺寸.