How to make only MPMoviePlayerController in both l

2019-09-09 04:33发布

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条回答
劫难
2楼-- · 2019-09-09 04:46

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;
}
查看更多
登录 后发表回答