【发布时间】:2011-06-18 06:02:58
【问题描述】:
我的应用程序使用导航控制器,我正在尝试插入横向支持! 我有我的 NavigationController 和一个视图,使用 IBAction(在 UIButton 处连接)调用此代码:
view *myview = [[view alloc] initWithNibName:@"view" bundle:[NSBundle mainBundle]];
[self pushViewController:myview animated:YES];
当然,我已经在我的 NavigationController_Class 中导入了“myview.h”
因此,对于景观,我已将此代码插入“myview.m”和“NavigationController_Class.m”中
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
有什么问题? 它可以工作,但是当您触摸从堆栈中弹出视图的按钮时,它不是从右到左滚动,而是从上到下滚动!
你知道可能是什么问题吗? 谢谢!
【问题讨论】:
-
你真的应该在 shouldAutorotateToInterfaceOrientation: - 方法中返回 YES,因为你支持所有四个方向。
-
好的,好的,谢谢!但是问题没有解决,没有任何改变! navigationControlles 仍然向上滚动
标签: ios swift uinavigationcontroller landscape