仅在ios6中使用MPMoviePlayerController在全屏模式下以横向模式显示视频

时间:2013-09-16 06:06:13

标签: ios6 mpmovieplayercontroller

我希望仅在使用ios6中的MPMoviePlayerController全屏播放视频时才以横向模式显示视频。我的应用程序仅支持纵向模式。

任何人都可以建议我,我该怎么做?

感谢。

2 个答案:

答案 0 :(得分:1)

我从下面的链接

得到了答案

iOS 6 MPMoviePlayerViewController and presentMoviePlayerViewControllerAnimated Rotation

将应用程序委托文件中的更改设置为fllows及其工作:

仅将UIview名称更改为ios6中的MPSwipableView

- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
   if ([[self.window.subviews.lastObject class].description isEqualToString:@"MPSwipableView"]) {
      return UIInterfaceOrientationMaskAllButUpsideDown;
   }
   else {
      return UIInterfaceOrientationMaskPortrait;
   }
}

答案 1 :(得分:0)

在viewController中,实现此方法

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape
}
相关问题