Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.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 UINavigationController横向模式下的导航堆栈问题_Iphone_Ipad_Uinavigationcontroller_Uitabbarcontroller_Popviewcontroller - Fatal编程技术网

Iphone UINavigationController横向模式下的导航堆栈问题

Iphone UINavigationController横向模式下的导航堆栈问题,iphone,ipad,uinavigationcontroller,uitabbarcontroller,popviewcontroller,Iphone,Ipad,Uinavigationcontroller,Uitabbarcontroller,Popviewcontroller,我有一个iPhone应用程序,目前我正在将其转换为与iPad一起工作的应用程序。我已经成功地实现了布局方面所需的一切,因此我的应用程序现在支持完整的横向功能(以前我主要使用纵向模式来显示内容) 但是,我有一个奇怪的问题,它只发生在横向模式下:当我将视图控制器推到堆栈上时,只需点击两下后退按钮即可返回到上一个视图控制器!第一次轻触显示一个空白视图,但在左侧的“后退导航”按钮上具有相同的名称,第二次轻触将控制器恢复到以前的视图 我没有iPad要测试,所以我依赖模拟器。这个问题不会在iPhone上出现

我有一个iPhone应用程序,目前我正在将其转换为与iPad一起工作的应用程序。我已经成功地实现了布局方面所需的一切,因此我的应用程序现在支持完整的横向功能(以前我主要使用纵向模式来显示内容)

但是,我有一个奇怪的问题,它只发生在横向模式下:当我将视图控制器推到堆栈上时,只需点击两下后退按钮即可返回到上一个视图控制器!第一次轻触显示一个空白视图,但在左侧的“后退导航”按钮上具有相同的名称,第二次轻触将控制器恢复到以前的视图

我没有iPad要测试,所以我依赖模拟器。这个问题不会在iPhone上出现,如果您旋转回纵向模式,也不会出现

我的应用程序由一个tabbarcontroller组成,其中包含为其vc加载的导航控制器:

//application delegate
- (void)applicationDidFinishLaunching:(UIApplication *)application
//....
WebHelpViewController *vc8 = [[WebHelpViewController alloc] init];
UINavigationController *nv8 = [[UINavigationController alloc] initWithRootViewController:vc8];

[self.tabBarController setViewControllers:[NSArray arrayWithObjects:nv1,nv2,nv3,nv4,nv5,nv6,nv7,nv8,nil]];
为了实现横向功能,UITabBarController在需要时被覆盖为自动旋转:

//CustomTabBarController.m
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return [[(UINavigationController *)self.selectedViewController topViewController] shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}
。。。很好。我使用此方法导航到新视图

SomeViewController *vc = [[SomeViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
[vc release];

这只是一个模拟错误吗?如何解决此问题?

听起来好像另一个
ViewController
正在响应:

(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

先检查一下。

谢谢,伙计,这就是问题所在。我需要确保我实现的所有ViewController-(BOOL)都应该自动旋转指针FaceOrientation:(UIInterfaceOrientation)interfaceOrientation;如果您使用
CMD+N
在XCode中创建新的
UIViewController
,此方法是模板中包含的默认方法之一。grrr我面临的问题与此完全相同:我将导航控制器显示为模态,然后推送一些ViewController。navController和所有按下的控制器返回YES到shouldAutorotateToInterfaceOrientation,但在横向中,我需要按“back”两次以正确更新导航栏:/any idea?哼,我没有覆盖导致问题的默认控制器的此方法:/。