您的位置:首页 > 产品设计 > UI/UE

[[UIScreen mainScreen] bounds] 得到的大小跟什么有关系?

2015-12-08 14:12 555 查看
就是屏幕大小,启动图决定

Why [UIScreen mainScreen].bounds] is not returning full screen
size?

I have an app that was created prior to the new iPhone 5 retina widescreen device.Now i am trying to support this high definition widescreen.

I adjust the main ViewController and the main window XIB files so that they are set to Autolayout. I can verify that the width/height displayed via the IB shows 320 x 568.

However, when I run in simulator, i can see that the height is still 480.The code im using to print the height (and width) is in the main view controller's viewWillAppear method:

[UIScreen mainScreen].bounds]
[/code]
Why is the size.height still 480 instead of 568?

You have to add the iPhone 5 Launch image (
Default-568h@2x.png
) to your project.

The 568 point tall launch image tells iOS to launch your app in 4" mode. If you don't have this image, your app is treated as a 3.5" app. Even if it is 4" compatible.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: