最新版本的iOS带来了许多视觉变化,从开发者的Angular 来看,导航和状态栏是两个值得注意的变化.
状态栏现在是透明的,它后面的导航栏可以显示出来.导航栏图像甚至可以扩展到状态栏后面.
首先,如果你是一名初学者,刚刚开始iOS开发,对状态栏和导航栏的工作方式感到困惑,你可以简单地浏览我发现非常有用的博客文章HERE.它拥有iOS 7中与导航和状态栏相关的所有信息.
现在来回答你的问题.首先,我可以看到两个不同的问题.一个是,你的状态栏和导航栏都有点相互冲突,就像你在问题中用图片显示的那样.
问题是,您之前在视图控制器中拖动了一个导航栏,该导航栏在iOS 6中正常工作,但随着iOS 7 SDK的到来,这种方法导致状态栏和导航栏相互重叠.
SOLUTION to First Problem:您可以使用UIBarPositionTopAttached,也可以使用视图边界和框架,我也可以建议您将其链接到Apple's documentation和bla bla bla bla bla,但这将需要一些时间来解决问题.
The best and the most easiest way to solve this issue is to just embed your view controller inside a navigation controller and thats it. You can do it by just selecting the view controller and going to Editor > Embed In > Navigation Controller. (If there is any content on your old navigation bar, you can first drag it down, embed the view controller in navigation controller and then move the bar buttons on the new navigation bar and then delete the old navigation bar)
SOLUTION to Second Problem:本解决方案针对您在更新中提到的具体问题,不适用于阅读本手册的普通公众.正如您所见,导航和状态栏不可见,一个透明区域显示父视图控制器.我真的不明白你为什么要面对这个问题,但很可能是因为一些第三方库,如ECSlidingView或任何其他涉及.您可以在故事板中 Select 此视图控制器,并将视图的背景色设置为与导航栏相同.这将停止显示后面的父视图控制器,导航栏和状态栏将开始显示.现在,您可以使用文本视图或您在其中使用的内容覆盖视图控制器的其余部分.
希望这有帮助!