导航栏上的iOS7状态栏 [英] iOS7 Status Bar over Navigation Bar

查看:118
本文介绍了导航栏上的iOS7状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iOS7测试我的应用程序,我的状态栏有问题。基本上状态栏显示在导航栏上,如下图所示:

I'm testing my application with iOS7 and I have an issue with status bar. Basically the status bar appear over navigation bar like the image below:

我尝试拨打 viewDidLoad

 self.edgesForExtendedLayout = UIRectEdgeNone;
 self.automaticallyAdjustsScrollViewInsets = YES;

没有成功。

我也有添加到 info.plist 文件 UIViewControllerBasedStatusBarAppearance 没有运气。

I have also added to the info.plist file UIViewControllerBasedStatusBarAppearance with no luck.

主要问题是应用程序必须与iOS6和iOS7兼容,目前在iOS7上,视图从顶部移动了20px。

The main problem is that the application must be compatible with iOS6 and iOS7 and currently on iOS7 the view shifted 20px from the top.

推荐答案

edgesForExtendedLayout automatedAdjustsScrollViewInsets 只是父视图控制器如何布局/管理视图的标准。看起来你正在使用UINavigationBar,而不是UINavigationController,这意味着除非你将它们编码,否则这些属性不会做任何事情。

edgesForExtendedLayout and automaticallyAdjustsScrollViewInsets are just standards for how parent view controllers lay out / manage the view. It looks like you're using a UINavigationBar, but not a UINavigationController, which means these properties won't do anything unless you code them to.

你可以切换到使用UINavigationController,或者您可以在iOS 7上以编程方式将UINavigationBar的高度从44更改为64.

You can switch to use a UINavigationController, or you can programmatically change the height of your UINavigationBar from 44 to 64 on iOS 7.

这篇关于导航栏上的iOS7状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆