Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.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
Ios 选项卡栏应用程序中的方向_Ios_Youtube_Screen Orientation - Fatal编程技术网

Ios 选项卡栏应用程序中的方向

Ios 选项卡栏应用程序中的方向,ios,youtube,screen-orientation,Ios,Youtube,Screen Orientation,我已经创建了一个选项卡栏应用程序,除了在应用程序的一个视图控制器中使用Web视图全屏播放youtube视频外,我希望始终以纵向方式显示该应用程序 如何执行此操作???在项目设置中,选择纵向、横向左侧和横向右侧设备方向 在TabBarController类中,重写supportedInterfaceOrientation方法。请参阅下面的代码。将此代码复制并粘贴到TabBarController中 -(NSUInteger)supportedInterfaceOrientations { re

我已经创建了一个选项卡栏应用程序,除了在应用程序的一个视图控制器中使用Web视图全屏播放youtube视频外,我希望始终以纵向方式显示该应用程序


如何执行此操作???

在项目设置中,选择纵向、横向左侧和横向右侧设备方向

在TabBarController类中,重写supportedInterfaceOrientation方法。请参阅下面的代码。将此代码复制并粘贴到TabBarController中

-(NSUInteger)supportedInterfaceOrientations
{
  return UIInterfaceOrientationMaskPortrait;
}
这确保选项卡栏视图始终保持纵向

在具有web视图的ViewController中,实现以下版本的supportedInterFaceOrientation方法

-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight |   UIInterfaceOrientationMaskLandscapeLeft;
}
这可确保具有web视图的ViewController可以更改为横向

注意:以模式显示具有web视图的ViewController。它不应该是TabBarController中的选项卡