How to make only MPMoviePlayerController in both landscape and portrait mode

↘锁芯ラ 提交于 2019-12-12 01:08:41

问题


I am working on a application which has to play videos when clicking on some thumbnail, I am displaying list. I want only the Video to rotate in Landscape and Portrait Mode but other screens must in Portrait Mode How can we do this.


回答1:


In ViewWillAppear

UIViewController *vc = [[UIViewController alloc] init];
    [self presentViewController:vc animated:NO completion:NULL];
    [self dismissViewControllerAnimated:NO completion:NULL];

This will trigger the redrawing of the view and thus calling following functions, provided you have implemented these

- (BOOL)shouldAutorotate{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;
}


来源:https://stackoverflow.com/questions/17143945/how-to-make-only-mpmovieplayercontroller-in-both-landscape-and-portrait-mode

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