Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ios6中的MPMoviePlayerController,仅在全屏上以横向模式显示视频_Ios6_Mpmovieplayercontroller - Fatal编程技术网

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

使用ios6中的MPMoviePlayerController,仅在全屏上以横向模式显示视频,ios6,mpmovieplayercontroller,Ios6,Mpmovieplayercontroller,我只想在ios6中使用MPMoviePlayerController全屏播放视频时,以横向模式显示视频。我的应用程序只支持纵向模式 谁能建议我怎么做 谢谢。在您的viewController中,实现此方法 -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape } 我从下面的链接得到了答案 将应用程序委托文件更改为FLOWS及其工作模式: 仅在ios6中将UIvi

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

谁能建议我怎么做


谢谢。

在您的viewController中,实现此方法

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape
}

我从下面的链接得到了答案

将应用程序委托文件更改为FLOWS及其工作模式:

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

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

您好,谢谢您的回复,但这会导致应用程序崩溃。我的整个应用程序只支持纵向模式,我想设置全屏视频的横向模式。***由于未捕获的异常“UIApplicationInvalidInterfaceOrientation”而终止应用程序,原因是:“受支持的方向与应用程序没有共同的方向,并且应自动旋转正在返回YES”实现此方法,-(BOOL)应自动旋转{返回(!UIInterfaceOrientationSpatureUpsideDown);}我也尝试过此方法,但是不要改变方向。嗨,谢谢你的回复,但是从下面的链接中得到了答案