如何在Iphone应用程序中隐藏状态栏 [英] how to hide status bar in Iphone application
问题描述
如何隐藏状态栏。
在sdk 3.1或更低版本中可以通过添加此代码来实现
in sdk 3.1 or lower version it is possible by adding this code in
- (void)applicationDidFinishLaunching:(UIApplication *)application{
[application statusBarHidden:TRUE];
}
但在4.1中这种方法在委托类中不可用。我可以看到这样的网站
but in 4.1 this method is not available in delegate class. i can see some site like this
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
它也无效。
任何人都知道在iPhone sdk 4.1中它怎么可能?
it is also not working. any body know that how it will possible in iPhone sdk 4.1 ?
谢谢和问候..
推荐答案
如果您在 applicationDidFinishLaunching:
上这样做,有一种更简单的方法:
if you are doing it on the applicationDidFinishLaunching:
there is an easier way of doing it:
隐藏状态栏的最简单方法(这适用于任何版本)是进入你的 Info.plist
;右键单击添加一行并选择状态栏最初隐藏。
The easiest way to hide the status bar (and this will work on any version) is to go into you Info.plist
; right click to add a row and select Status Bar Initially hidden.
这将确保每次启动应用程序时状态栏都将被隐藏。
This will ensure every time you app launches the status bar will be hidden.
如果你需要,我可以发布scree镜头,只是让我知道并希望这有帮助。
I can post scree shots if you need them, just let me know and hope this helps.
这篇关于如何在Iphone应用程序中隐藏状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!