我在 tabbarcontroller 中有一个“VideoLecturesDetails”,这个类有这个方法
-(IBAction) playVideo{
NSString *fileURL = [NSString stringWithFormat:@"%@" ,FileName];
NSURL* videoURL = [NSURL URLWithString:fileURL];
MPMoviePlayerViewController* theMoviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];
[theMoviePlayer shouldAutorotate];
[self presentMoviePlayerViewControllerAnimated:theMoviePlayer];
}
-(BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers {
return NO;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return YES;//This allows all orientations, set it to whatever you want
}
所以在播放视频时自动旋转不起作用,我怎样才能使用这种方法启用自动旋转。