Portrait-mode app, return to portrait mode after landscape fullscreen movieplayer

给你一囗甜甜゛ 提交于 2019-12-11 04:55:52

问题


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

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