隐藏启动图像上的状态栏 [英] Hide status bar on launch image
本文介绍了隐藏启动图像上的状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当应用的启动图像显示 然后将其恢复时,有没有办法隐藏状态栏?
我的应用有黑色状态栏并且在启动图像上显示的那个是灰色的。
Is there a way to hide the status bar when the app's launch image is displayed and then bring it back? My app has a black status bar and the one displayed over the launch image is grey.
有没有解决方案?
推荐答案
使用此代码隐藏状态栏:
Use this code for hiding status bar:
ObjectiveC:
[[UIApplication sharedApplication] setStatusBarHidden:YES
withAnimation:UIStatusBarAnimationSlide];
Swift:
UIApplication.sharedApplication().setStatusBarHidden(true, withAnimation: .Slide)
如果您在开头不需要状态栏。在您的信息 plist
文件中添加此设置( UIStatusBarHidden
):
If you don't need status bar in the beginning. Add this setting (UIStatusBarHidden
) in your Info plist
file:
Status bar is initially hidden
值 YES
。
在应用程序的任何位置使用此代码显示状态栏特定的View Controller
Use this code anywhere in the app to show the status bar for that particular View Controller
ObjectiveC:
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
Swift:
UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: .Slide)
这篇关于隐藏启动图像上的状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文