问题
My application is in landscape mode and I use MPMoviePlayerController to play an sample video. It works fine but when I stop the video with the OK button (or if I wait until the movie ends), the orientation automatically changes to portrait. Is it possible to keep application in landscape mode when the OK button is pushed ?
I use the followwing code in my main view controller to force landscape mode :
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
回答1:
I think on the MPMoviePlayerPlaybackDidFinishNotification notification you have to set the statusbarorientation back to landscape.
来源:https://stackoverflow.com/questions/2324745/iphone-prevent-application-to-automatically-change-orientation-to-portrait-when