Ios 选项卡栏应用程序中的方向
我已经创建了一个选项卡栏应用程序,除了在应用程序的一个视图控制器中使用Web视图全屏播放youtube视频外,我希望始终以纵向方式显示该应用程序Ios 选项卡栏应用程序中的方向,ios,youtube,screen-orientation,Ios,Youtube,Screen Orientation,我已经创建了一个选项卡栏应用程序,除了在应用程序的一个视图控制器中使用Web视图全屏播放youtube视频外,我希望始终以纵向方式显示该应用程序 如何执行此操作???在项目设置中,选择纵向、横向左侧和横向右侧设备方向 在TabBarController类中,重写supportedInterfaceOrientation方法。请参阅下面的代码。将此代码复制并粘贴到TabBarController中 -(NSUInteger)supportedInterfaceOrientations { re
如何执行此操作???在项目设置中,选择纵向、横向左侧和横向右侧设备方向 在TabBarController类中,重写supportedInterfaceOrientation方法。请参阅下面的代码。将此代码复制并粘贴到TabBarController中
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
这确保选项卡栏视图始终保持纵向
在具有web视图的ViewController中,实现以下版本的supportedInterFaceOrientation方法
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
这可确保具有web视图的ViewController可以更改为横向
注意:以模式显示具有web视图的ViewController。它不应该是TabBarController中的选项卡