[[UIScreen mainScreen] bounds] 得到的大小跟什么有关系?
2015-12-08 14:12
555 查看
就是屏幕大小,启动图决定
Why [UIScreen mainScreen].bounds] is not returning full screen
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:
Why is the size.height still 480 instead of 568?
You have to add the iPhone 5 Launch image (
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.
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.
相关文章推荐
- UI基础学习之(八):UISegmentedControl
- UI基础学习之(七):UIViewController
- 【译】使用UIKit进行面向对象的编程
- UI基础学习之(六):程序的启动过程
- UIView
- Arduino - Tiny RTC 12C 时钟模块
- UI基础学习之(五):UIButton
- easyui datagrid getChecked只能获取一行的问题
- UI基础学习之(四):UITextFiled Delegate
- UIViewController的生命周期(图解)
- UESTC-1259 昊昊爱运动 II
- 猫学习IOS(三)UI纯代码UI——图片浏览器
- UIScrollview与Autolayout的那点事
- 设置键盘只能输入数字( phoneNumTextField.keyboardType = UIKeyboardTypeNumberPad;)
- UITableView滑动动画+FPSLabel
- @UIColor colorWithPatternImage方法
- Java Base —— GUI
- LeetCode(225) Implement Stack using Queues
- LeetCode(225) Implement Stack using Queues
- Android AutoLayout全新的适配方式 堪称适配终结者---TabLayout:另一种 Tab 的实现方式----QuickReturn:用于ScrollView 和 ListView 的