在一个视图上隐藏iPhone上的状态栏? [英] Hide the status bar on iPhone on a single view?

查看:187
本文介绍了在一个视图上隐藏iPhone上的状态栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在所有视图中显示我的应用中的状态栏,但只有一个。我已尝试修改plist中的状态栏最初隐藏,我试过:

I want to show the status bar in my app in all views but one. I have tried modifying the 'status bar is initially hidden' in the plist, i have tried:

[[UIApplication sharedApplication] setStatusBarHidden:YES];

隐藏栏,但留下一个丑陋的蓝色框状态栏(不是其中的一部分)我的观点是,那里没有任何蓝色。)

That hides the bar but leaves an ugly blue box where the status bar was (which isn't part of my view, there's nothing blue on there).

我还尝试在Xcode 4.2的界面构建器位中更改布局需要全屏和状态栏设置。

I have also tried altering the layout wants full screen and status bar settings in the 'interface builder' bit of Xcode 4.2.

有任何建议吗?

编辑 - 解决方案的分类:

EDIT - SORT OF SOLUTION:

我已经完成了包括:

    -(void)viewWillDisappear:(BOOL)animated{


    [[UIApplication sharedApplication] setStatusBarHidden:YES];

}


-(void)viewDidAppear:(BOOL)animated{


    [[UIApplication sharedApplication] setStatusBarHidden:NO];

}

在我想要状态栏的每一页上on。

on every single page that I want the status bar to be on.

它仍然看起来不稳定和垃圾,因为标签栏出现并在每次切换视图时重新出现。但是我已经受够了,在这个愚蠢的问题上工作了大约5个小时,所以这将是必须的。

It still looks choppy and rubbish because the tab bar appears and reappears each time you switch a view. But i've had enough, worked on this stupid problem for about 5 hours now so this will have to do.

第二次编辑 -

通过在viewWillAppears中包含setStatusBarHidden = NO来修复波动性。上帝知道一切是如何运作的,但事实确实如此。

Fixed the choppyness by including setStatusBarHidden=NO in viewWillAppears. God knows how everything works but it does.

推荐答案

尝试这一个它将完美运行..

Try This one It will Run perfectly..

[[UIApplication sharedApplication] setStatusBarHidden:YES];

在XIB中为状态栏设置无选项。

And in XIB set none option for the status bar.

转到info.plist并添加两个属性(如果不存在)。将状态栏最初隐藏设置为是并将UIViewControllerBasedStatusBarAppearance设置为NO。这将隐藏您应用的状态栏。

Go to info.plist and add two attributes if not present. set "Status bar is initially hidden" to "YES" and set "UIViewControllerBasedStatusBarAppearance" to "NO". This will hide status bar for your app.

这篇关于在一个视图上隐藏iPhone上的状态栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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