问题
So I have an application only in Portrait mode. If I launch a movie player in fullscreen and rotate it to landscape mode, and then I press on the Done button, the status bar is in landscape mode, and the view is in portrait layout but in landscape mode so showing just on part of the scree.
If i rotate the device myself, the views are reset properly, but i need a way to do this programmatically.
I tried this: shouldAutorotateToDeviceOrientation returns true for portrait mode only
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_moviePlayerWillExitFullscreen:)
name:MPMoviePlayerWillExitFullscreenNotification object:nil];
- (void)_moviePlayerWillExitFullscreen:(NSNotification *)notification {
1) [self willRotateToInterfaceOrientation:self.interfaceOrientation duration:0];
2) [self attemptRotationToDeviceOrientation];
}
来源:https://stackoverflow.com/questions/10847652/portrait-mode-app-return-to-portrait-mode-after-landscape-fullscreen-movieplaye