无法在iOS中获得半透明状态栏 [英] Can't get a translucent status bar in iOS

查看:179
本文介绍了无法在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;

就是这样!

这篇关于无法在iOS中获得半透明状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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