问题
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