I had the same problem:
- start application in portrait (for instance)
- launch video player (ours is shown using presentModalViewController).
- rotate iPad
- exit video by pressing 'Done'.
Bam! Our application's layout is broken (we do some custom layout for each orientation), and the status bar is at the wrong place, despite being at the correct place when in video.
I did two things to fix the two issues :
- make sure our custom configuration, which is done in viewWillAppear, is done AFTER calling `[super viewWillAppear];.
- implement observers for MPMoviePlayerDidExitFullscreenNotification and MPMoviePlayerPlaybackDidFinishNotification (the first one never got called when clicking 'Done' in my case).
The code for the observer's callback is looking like this:
[self performSelector: @selector(checkAndFixStatusBar)
withObject: nil
afterDelay: 0];
[[NSNotificationCenter defaultCenter] removeObserver: self];
And the final method, called after an intentional 0 delay:
- (void)checkAndFixStatusBar
{
UIInterfaceOrientation intOrient = self.interfaceOrientation;
UIInterfaceOrientation sbOrient = [[UIApplication sharedApplication] statusBarOrientation];
if (intOrient != sbOrient)
{
[[UIApplication sharedApplication] setStatusBarOrientation: intOrient animated: NO];
NSLog(@"Fixed status bar orientation");
}
}
There is still a perceivable blinking of the status bar, but that's the best I came up with.
Hope this helps.
EDIT: I've removed the performSelector step, and directly called the status bar setup, in my case, it makes no noticeable difference (still blinking).