Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.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 自动旋转5个选项卡中的1个选项卡_Iphone_Tabs_Rotation - Fatal编程技术网

Iphone 自动旋转5个选项卡中的1个选项卡

Iphone 自动旋转5个选项卡中的1个选项卡,iphone,tabs,rotation,Iphone,Tabs,Rotation,我的应用程序中有5个标签,其中一个需要能够自动旋转。到目前为止,我已经能够使用以下工具旋转所有5个选项卡: (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{ return YES; } 然而,我只需要1旋转。如何执行此操作?您可以尝试使用myTabBarController.selectedIndex或myTabBarController.selected

我的应用程序中有5个标签,其中一个需要能够自动旋转。到目前为止,我已经能够使用以下工具旋转所有5个选项卡:

(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
    return YES;
}

然而,我只需要1旋转。如何执行此操作?

您可以尝试使用myTabBarController.selectedIndex或myTabBarController.selectedViewController检查活动选项卡。根据哪个选项卡处于活动状态返回是或否

但要注意:如果在非旋转选项卡中旋转设备(即不发生任何事情),然后转到旋转选项卡,会发生什么?我的猜测是,它将处于以前的未旋转状态,因为它从未收到任何有关旋转的消息