Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.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 如果从其他视图返回,则不会调用willRotateToInterfaceOrientation方法_Iphone_Xcode_Ios_Orientation_Landscape - Fatal编程技术网

Iphone 如果从其他视图返回,则不会调用willRotateToInterfaceOrientation方法

Iphone 如果从其他视图返回,则不会调用willRotateToInterfaceOrientation方法,iphone,xcode,ios,orientation,landscape,Iphone,Xcode,Ios,Orientation,Landscape,我在处理iPhone中的设备定位时遇到了很多麻烦。更改设备方向时,我必须添加/删除隐藏/取消隐藏,尤其是NavigationController的工具栏 情景: [设备处于纵向] DetailViewController启动。。根据横向或纵向方向设置其视图。(现在是肖像)在willRotateToInterfaceOrientation方法中 点击按钮后,视图将被推送到新的ViewController。它还支持纵向和横向。现在,设备在NewViewController中切换为横向。一切都好。 这

我在处理iPhone中的设备定位时遇到了很多麻烦。更改设备方向时,我必须添加/删除隐藏/取消隐藏,尤其是NavigationController的工具栏

情景:

[设备处于纵向]

DetailViewController启动。。根据横向或纵向方向设置其视图。(现在是肖像)在willRotateToInterfaceOrientation方法中

点击按钮后,视图将被推送到新的ViewController。它还支持纵向和横向。现在,设备在NewViewController中切换为横向。一切都好。 这就是问题所在,当点击“返回”到DetailViewController(最后一次在纵向中看到)时,它在横向中时不会进行隐藏/取消隐藏更改。因为,根本不调用willRotateToInterface。在“viewwillexpect”中添加函数不是一个好方法

概括地说: DETAILVEWCONTROLLER(纵向)-->推送-->新建视图控制器(纵向)-->旋转-->新建视图控制器(横向)--->推送-->详细视图控制器(横向)(在DetailViewController中不调用willRotate)

在这种情况下,正确的方法是什么?正确的方法。内存占用最少

谢谢:)