如何在 Iphone 应用程序中隐藏状态栏 [英] how to hide status bar in Iphone application

查看:68
本文介绍了如何在 Iphone 应用程序中隐藏状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何隐藏状态栏.

在 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;右键添加一行,然后选择 Status Bar Initially hidden.

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.

如果您需要,我可以发布碎石照片,请告诉我,希望对您有所帮助.

I can post scree shots if you need them, just let me know and hope this helps.

这篇关于如何在 Iphone 应用程序中隐藏状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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