iPhone Prevent application to automatically change orientation to portrait when a video stop

删除回忆录丶 提交于 2019-12-11 04:13:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!