在播放iphone视频时隐藏状态栏 [英] Hide status bar while playing video for iphone
问题描述
我正在尝试隐藏iphone应用程序开发的状态栏。但是当我正在播放视频时,状态栏会在此之后回到之前的屏幕状态栏显示。如果我没有播放任何视频而不是整个应用程序状态栏隐藏。
你可以帮我隐藏视频屏幕上的状态栏,即使我试过[[ UIApplication sharedApplication] setStatusBarHidden:YES];在播放视频之前。但这不起作用。
谢谢,
KamalBhr
[[UIApplication sharedApplication] setStatusBarHidden:YES]; // iOS3
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade ]; // iOS4
基本上是要走的路,但重要的部分是分别何时到如果您正在为iOS4或iPhone OS 3.0开发,那么请稍微调整一下。
in当通知 MPMoviePlayerContentPreloadDidFinishNotification
被触发时,iOS 3用于隐藏状态栏。
在iOS4中我没有在设置我的 MPMoviePlayerViewController
的moviePlayer属性的ContentURL之前隐藏吧有任何问题。
我希望我可以帮忙。
sam
I am trying to hide status bar for iphone application development.But when i am playing video at that that status bar come and after that when i come back to previous screen status bar showing . If i am not playing any video than whole application the status bar hiding.
Can you please help me to hide status bar on video screen ,even i tried for "[[UIApplication sharedApplication] setStatusBarHidden:YES];" before playing video .but this is not working. "
Thanks, KamalBhr
[[UIApplication sharedApplication] setStatusBarHidden:YES];//iOS3
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; //iOS4
is basically the way to go, but the important part is where respectively when to call it.
that depends a bit if you're developing for iOS4 or iPhone OS 3.0.
in iOS 3 is used to hide the status bar when the Notification MPMoviePlayerContentPreloadDidFinishNotification
was fired.
in iOS4 i didn't have any problems hiding the bar before i set the ContentURL of my MPMoviePlayerViewController
's moviePlayer property.
i hope i could help.
sam
这篇关于在播放iphone视频时隐藏状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!