问题描述
我正在开发应用程序以在iphone4和iPhone 5上工作。我使用以下代码来获取屏幕尺寸
I'm developing the app to work both on iphone4 and iPhone 5. I'm using the following code to get the screen size
CGRect screenBounds = [[UIScreen mainScreen] bounds];
我正在使用iPhone 5模拟器,但它显示的是iPhone 4的屏幕尺寸。
am using the iPhone 5 simulator but it showing the screen size of iPhone 4.
推荐答案
在模拟器上确保已设置为iPhone(Retina 4英寸)。
您可以通过顶部的模拟器菜单进入硬件>>设备>> iPhone(Retina 4英寸),将手机模拟器更改为iPhone 5版本。
On the simulator make sure you have set to iPhone (Retina 4-inch).You can do this by going simulator menu at the top go to Hardware>>Device>>iPhone (Retina 4-inch) that will change the phone simulator to the iPhone 5 version.
如果设置了这个,那么您可能需要为iPhone 5添加启动图像。 [email protected]
如果缺少它将无法在iPhone上发布(Retina 4英寸)。
If this is set then you may need to add a launch image for the iPhone 5. [email protected]
if this is missing it will not launch in iPhone (Retina 4-inch).
我还回答了另一个问题可能有所帮助。
I have also answer another question here that may help.
这篇关于iPhone 5的屏幕尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!