无法在iOS中获得半透明状态栏
问题描述:
我正试图以编程方式在iOS(iOS 6)应用中获得标准的黑色半透明状态栏,但没有运气。我尝试在info.plist中添加键/值,以及添加...
I'm trying to get the standard black translucent status bar in my iOS (iOS 6) app programmatically with no luck. I tried adding the key/value in my info.plist, as well as adding...
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
......无效。还有什么可能造成这种情况?
...to no effect. What else could be causing this?
答
感谢大家的投入!你可以在info.plist中设置它,或者使用
Thank you everyone for your input! You can set it in the info.plist, or use
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
原来它是半透明的 - 下面什么都没有。我缺少的是我的视图控制器中的这一行
Turns out it was translucent - there was just nothing underneath. What i was missing was this line in my view controller
self.wantsFullScreenLayout = YES;
就是这样!