我有一个只有纵向模式的应用程序,但是当用户播放视频时,我希望它以全屏横向模式播放(视频播放器在纵向模式下看起来不太好)。我是这样玩的:
[self.view addSubview:myMoviePlayer.view];
[self.myMoviePlayer setFullscreen:YES animated:YES];
[self.myMoviePlayer play];
完成此任务的最佳方法是什么?
最佳答案
阅读这篇文章:
主要思想是:
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
[[self view] setBounds:CGRectMake(0, 0, 480, 320)];
[[self view] setCenter:CGPointMake(160, 240)];
[[self view] setTransform:CGAffineTransformMakeRotation(M_PI / 2)];
关于iphone - 强制 MPMoviePlayerController 以横向模式播放视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4740732/