2011-01-30 49 views
0

我的应用程序使用导航控制器,我试图插入横向支持! 我有我的NavigationController和看法,被称为与IBAction为(在一个UIButton连接)使用此代码:导航控制器在横向,弹出滚动

view *myview = [[view alloc] initWithNibName:@"view" bundle:[NSBundle mainBundle]]; 
[self pushViewController:myview animated:YES]; 

当然,我已经导入“myview.h”在我NavigationController_Class

所以,对于风景,我已经插在“myview.m”和“NavigationController_Class.m”

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
return ((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)); 
} 

什么问题该代码? 它可以工作,但是当您触摸堆栈中的视图弹出按钮时,它不会从右向左滚动,而是从上向下滚动!

你知道可能是什么问题吗? 谢谢!

+0

你真的应该在shouldAutorotateToInterfaceOrientation返回返回YES YES: - 方法,因为你支持所有四个方向。 – 2011-01-30 21:22:37

回答

3

即时猜测你有一个UINavigationControllerUITabBarController

的解决方案是覆盖在导航堆栈每个视图控制器的shouldAutorotateToInterfaceOrientation:方法(最后一个是没有必要的),以及支撑取向

相关问题