状态栏不会消失 [英] Status bar won't disappear

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

问题描述

我正在创建一个应用程序,我想隐藏状态栏。当我测试应用程序时,状态栏会在显示启动画面时隐藏,但一旦应用程序完全加载,状态栏就会重新出现。

I'm creating an application and I want the status bar hidden. When I test the app, the status bar is hidden whilst the splash screen is shown, but once the app is fully loaded, the status bar reappears.

我正在使用Xcode 5和iOS 7,并尝试以编程方式禁用状态栏

I'm using Xcode 5 and iOS 7, and have tried disabling the status bar programatically

  ([[UIApplication sharedApplication] setStatusBarHidden:YES    
      withAnimation:UIStatusBarAnimationFade];),

在info.plist文件中,并使用属性检查器.xib文件。什么都没有效果。

in the info.plist file, and using the attributes inspector on the .xib file. Nothing appears to work.

任何想法?

推荐答案

尝试将以下方法添加到您的app的根视图控制器:

Try adding the following method to your app's root view controller:

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

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

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