iOS7状态栏问题 [英] iOS7 Status Bar issue
问题描述
我在iOS 7中找到了很多关于状态栏问题的链接,但没有一个帮助太多。
I have found many links for Status Bar issue in iOS 7 bt none of them helped much.
问题是我的应用程序在iOS6中运行良好但是当我尝试要在iOS7上运行它,我想要iOS7的外观。
The issue is my application runs well in iOS6 but when I try to run it on iOS7, I want the iOS7 look and feel.
状态栏很好地用 UIViewController
如下所示:
The status bar gels nicely with a UIViewController
like below :
但是对于 UINavigationController
它会变成黑色,如下所示:
But for UINavigationController
it goes black like below :
我设法使用AppDelegate中的以下代码更改statusBar的文本颜色:
I managed to change the text-color of the statusBar using the following code in AppDelegate :
if ([[UIView appearance] respondsToSelector:@selector(setTintColor:)]) {
[[UIView appearance] setTintColor:[UIColor whiteColor]];
}
另外,我的plist文件包含以下条目:
查看基于控制器的状态栏外观
设置为否
Also, my plist file has the following entry :
View controller-based status bar appearance
set to NO
和我的AppDelegate有:
and my AppDelegate has :
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
我希望statusBar在加载NavigationController时采用蓝色。
I want the statusBar to take the Blue color when a NavigationController is loaded.
注意:我已经使用以下代码获得iOS7支持:
NOTE : I have used the following code for iOS7 support :
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
self.edgesForExtendedLayout=UIRectEdgeNone;
#endif
不知道是否会导致此问题。
Don't know if this caused the issue.
推荐答案
很难找到问题的解决方案,但尝试使用本指南,真的很好:
It's hard to find the solution to your problem, but try using this guide, is really good:
http://www.appcoda.com/customize -navigation-status-bar-ios-7 /
这篇关于iOS7状态栏问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!