Ios 横向导航控制器,弹出窗口向上滚动

Ios 横向导航控制器,弹出窗口向上滚动,ios,swift,uinavigationcontroller,landscape,Ios,Swift,Uinavigationcontroller,Landscape,我的应用程序使用导航控制器,我正在尝试插入横向支持! 我有我的NavigationController和一个视图,该视图通过iAction(通过UIButton连接)调用,代码如下: view *myview = [[view alloc] initWithNibName:@"view" bundle:[NSBundle mainBundle]]; [self pushViewController:myview animated:YES]; 当然,我已经在NavigationControlle

我的应用程序使用导航控制器,我正在尝试插入横向支持! 我有我的NavigationController和一个视图,该视图通过iAction(通过UIButton连接)调用,代码如下:

view *myview = [[view alloc] initWithNibName:@"view" bundle:[NSBundle mainBundle]];
[self pushViewController:myview animated:YES];
当然,我已经在NavigationController_类中导入了“myview.h”

因此,对于横向,我在“myview.m”和“NavigationController_Class.m”中插入了这段代码

有什么问题吗? 它可以工作,但是当你点击从堆栈弹出视图的按钮时,它不是从右向左滚动,而是从上向下滚动

你知道有什么问题吗?
谢谢

我猜您在
UITabBarController
中有一个
UINavigationController


解决方案是覆盖导航堆栈中每个视图控制器的
shouldAutorotateToInterfaceOrientation:
方法(不需要最后一个),并为支持的方向返回
YES
,我猜您在
UITabBarController
中有一个
UINavigationController


解决方案是覆盖导航堆栈中每个视图控制器的
shouldAutorotateToInterfaceOrientation:
方法(不需要最后一个),并为支持的方向返回
YES

您确实应该在shouldAutorotateToInterfaceOrientation:-方法中返回YES,因为你支持所有四个方向。好的,好的,谢谢!但是问题没有解决,什么都没有改变!导航控件仍然向上滚动您确实应该在shouldAutorotateToInterfaceOrientation:-方法中返回YES,因为您支持所有四个方向。好的,好的,谢谢!但是问题没有解决,什么都没有改变!导航控件仍然向上滚动
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 return ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
 }