问题
I'm not the only one who's having this kind of issue. Here's another one, Status bar height changes after playing a Youtube video. But I can't still find a way to solve this. I'm not using MPMoviePlayerController. I think I just have to use these codes;
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
self.webView.frame = CGRectMake(0.0,
20.0,
self.webView.frame.size.width,
self.webView.frame.size.height);
But it's not so working.
Please see this images below..

At first this is what my "Home" looks like.

Status bar disappears while playing a video from Youtube/Vimeo (or whatever).

When I go back, see them bunched up.

Found out that FB figure out how to handle this. They had their status bar appears right there.
Any help???
Cheers in advance!
回答1:
I don't know if apply for your case, but in my case the status bar appears after I loaded a UIImagePickerController and change my default screen orientation.
I fix this situation add application.statusBarHidden = YES; inside appDelegate like this:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
// Detect if I need to hide the StatusBar (optional)
if (iNeedToHide == YES) {
application.statusBarHidden = YES;
}
return UIInterfaceOrientationMaskLandscape;
}
I hope this helps you.
回答2:
I had to disable the animation when dismissing the video player. Place a notification for video did finish event:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(videoDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:controller.moviePlayer];
Then, inside the method, dismiss the view controller without animation:
- (void)videoDidFinish:(NSNotification *)notification {
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification
object:controller.moviePlayer];
[self dismissViewControllerAnimated:NO completion:nil];
}
来源:https://stackoverflow.com/questions/19291562/ios-7-status-bar-disappears-after-playing-a-video