Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.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
Iphone 如何使用UINavigationBarController和UIAbbarController在UIViewController中将设备定向停止到横向模式_Iphone_Ios6_Uitabbarcontroller - Fatal编程技术网

Iphone 如何使用UINavigationBarController和UIAbbarController在UIViewController中将设备定向停止到横向模式

Iphone 如何使用UINavigationBarController和UIAbbarController在UIViewController中将设备定向停止到横向模式,iphone,ios6,uitabbarcontroller,Iphone,Ios6,Uitabbarcontroller,如何使用UINavigationBarController+UIAbbarController在UIViewController中停止设备定向到横向模式。由各个视图控制器决定是否要自动旋转。容器视图控制器(如UINavigationController、选项卡栏控制器或您自己的控制器)通常委托给它们的子级来决定这一点。在视图控制器上添加/覆盖以下方法: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)t

如何使用UINavigationBarController+UIAbbarController在UIViewController中停止设备定向到横向模式。

由各个视图控制器决定是否要自动旋转。容器视图控制器(如UINavigationController、选项卡栏控制器或您自己的控制器)通常委托给它们的子级来决定这一点。在视图控制器上添加/覆盖以下方法:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return NO;
}

- (BOOL)shouldAutorotate
{
    return NO;
}

一个是较旧的样式,另一个是iOS6+样式

如果您想在xcode中完全删除应用程序的方向,可以设置支持的方向