获取iphone 6模拟器的屏幕尺寸不正确

时间:2015-04-28 05:47:36

标签: iphone ios7 xcode6

我正在开发一款非常老的Iphone应用程序,我们最近已迁移到iOS 8.我们正在使用

CGRect screenBounds = [[UIScreen mainScreen] applicationFrame];

要获得屏幕尺寸,但是对于 iphone 6模拟器,它将返回 568x320 用于横向模式。我们有3个启动图像默认,默认 - 568h 默认。有人可以告诉我为Iphone 6添加新的启动图像的命名约定。

2 个答案:

答案 0 :(得分:0)

以下代码可能对您有所帮助。

CGRect rect=[[UIScreen mainScreen] bounds];

它将返回适当的大小。 和启动画面名称是:

iphone 4/4s : Default@2x.png
iphone 5/5s : Default-568@2x.png
iphone 6    : Default-667h@2x.png
iphone 6plus:Default-736h@2x.png

答案 1 :(得分:0)

如果您为启动图像使用资产目录,则会为您枚举完整的大小,并且您不必担心文件命名约定。enter image description here

相关问题