更新时间:2023-12-04 15:55:40
在iOS7中,应用程序窗口从y = 0px开始(在iOS6-中,从y = 20px开始)。
in iOS7, the app windows starts from y=0px (in iOS6-, it begins at y=20px).
处理此问题的最快,最简单的方法(,因为您已经在使用Xcode5 ),是关闭自动版式并利用每个视图的 iOS6 / 7 Delta 值。
The quickest and easiest way to handle this, (and since you're already using Xcode5), is to switch off Autolayout and utilize the iOS6/7 Delta values for every view.
基本上:
viewController
的主视图
,然后取消选中 使用自动版式
subView
( UIButton
, UILabel
等) ,请转到框架设置部分viewController
's main view
and uncheck "Use Autolayout
"subView
(UIButton
, UILabel
etc), go to the frame setting section
输入值-20
这将通过在iOS7中保留20px来启动您的应用,但在iOS6中,-20px的ΔY将补偿您为每个 subView
额外分配了20px。
This will start your app by leaving 20px in iOS7 but back in iOS6, the ΔY of -20px will compensate for the extra 20px you had given to every subView
.
请参阅: IOS7中的状态栏和导航栏问题