Marlon
Marlon

Reputation: 81

iPhone SDK - how to hide and show the status bar together with the MPMoviePlayerController controls?

I'm using a MPMoviePlayerViewController to show a movie. I have set the MPMoviePlayerController to fullscreen. Now I want to hide the status bar as soon as the fullscreen controls start to fade out and show the status bar if the controls are visible.

If I'm using a UIWebView all this happens automatically. The status bar fades in and out together with the controls. How would you do that with a MPMoviePlayerController?

Thanks for any help.

Upvotes: 2

Views: 5135

Answers (3)

Adam Waite
Adam Waite

Reputation: 18855

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];

The animated bit is now deprecated so just use:

[[UIApplication sharedApplication] setStatusBarHidden:YES];

Upvotes: 0

Till
Till

Reputation: 27597

This will happen automagically for you once you use the MPMoviePlayerController property controlStyle and set to MPMovieControlStyleFullscreen.

player.controlStyle = MPMovieControlStyleFullscreen;

Upvotes: 0

Jatin Patel - JP
Jatin Patel - JP

Reputation: 3733

You can use to hide status bar

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];

and to show status bar

[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];

Upvotes: 3

Related Questions