如何隐藏iPhone应用程序中的状态栏
如何隐藏状态栏。
在 sdk 3.1 或更低版本中,可以通过在
- (void)applicationDidFinishLaunching:(UIApplication *)application{
[application statusBarHidden:TRUE];
}
中添加此代码来实现,但在 4.1 中,此方法在委托类中不可用。我可以看到一些像这样的网站
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
它也无法正常工作。 有人知道 iPhone sdk 4.1 中如何实现这一点吗?
谢谢和问候..
how to hide status bar .
in sdk 3.1 or lower version it is possible by adding this code in
- (void)applicationDidFinishLaunching:(UIApplication *)application{
[application statusBarHidden:TRUE];
}
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];
it is also not working.
any body know that how it will possible in iPhone sdk 4.1 ?
thanks and regards..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您的方法现已在 iOS 5 中弃用。您应该使用以下方法之一:
Your method is now deprecated for iOS 5. You should use one of the following:
在 iOS 7 中,将以下两项添加到 info.plist 中:
In iOS 7 , add the below two items another item to info.plist :
请在您的 AppDelegate 类中添加
[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
(或)
请在您的 Info.plist 文件中添加键 查看基于控制器的状态栏外观值为 NO。并且添加状态栏最初隐藏 是,
它确实对我有用
Please Add in Your AppDelegate Class
[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
(or)
Please Add In your Info.plist file add key View controller-based status bar appearance with value NO.and also add Status bar is initially hidden YES
It is really working for me
如果您在
applicationDidFinishLaunching:
上执行此操作,则有一种更简单的方法:隐藏状态栏的最简单方法(这适用于任何版本)是进入您
信息.plist
;右键单击添加行并选择状态栏最初隐藏。这将确保每次应用程序启动时状态栏都会被隐藏。
如果您需要的话,我可以发布屏幕截图,请告诉我并希望这会有所帮助。
if you are doing it on the
applicationDidFinishLaunching:
there is an easier way of doing it: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.
只需放入代表类即可。
它对我有用......我希望这对你有帮助。
Just put in delegate class.
It is working for me..I hope this will help you.