How to make only MPMoviePlayerController in both l

2019-09-09 04:35发布

问题:

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;
}