• <legend id='7iWKE'><style id='7iWKE'><dir id='7iWKE'><q id='7iWKE'></q></dir></style></legend>

      1. <small id='7iWKE'></small><noframes id='7iWKE'>

      2. <i id='7iWKE'><tr id='7iWKE'><dt id='7iWKE'><q id='7iWKE'><span id='7iWKE'><b id='7iWKE'><form id='7iWKE'><ins id='7iWKE'></ins><ul id='7iWKE'></ul><sub id='7iWKE'></sub></form><legend id='7iWKE'></legend><bdo id='7iWKE'><pre id='7iWKE'><center id='7iWKE'></center></pre></bdo></b><th id='7iWKE'></th></span></q></dt></tr></i><div id='7iWKE'><tfoot id='7iWKE'></tfoot><dl id='7iWKE'><fieldset id='7iWKE'></fieldset></dl></div>
          <bdo id='7iWKE'></bdo><ul id='7iWKE'></ul>

      3. <tfoot id='7iWKE'></tfoot>

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

        UINavigationController navigation stack problems in landscape mode(UINavigationController 横向模式下的导航堆栈问题)
          • <bdo id='furlt'></bdo><ul id='furlt'></ul>

              1. <i id='furlt'><tr id='furlt'><dt id='furlt'><q id='furlt'><span id='furlt'><b id='furlt'><form id='furlt'><ins id='furlt'></ins><ul id='furlt'></ul><sub id='furlt'></sub></form><legend id='furlt'></legend><bdo id='furlt'><pre id='furlt'><center id='furlt'></center></pre></bdo></b><th id='furlt'></th></span></q></dt></tr></i><div id='furlt'><tfoot id='furlt'></tfoot><dl id='furlt'><fieldset id='furlt'></fieldset></dl></div>
              2. <tfoot id='furlt'></tfoot>

                  <small id='furlt'></small><noframes id='furlt'>

                    <tbody id='furlt'></tbody>
                  <legend id='furlt'><style id='furlt'><dir id='furlt'><q id='furlt'></q></dir></style></legend>

                  本文介绍了UINavigationController 横向模式下的导航堆栈问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

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

                  I have an iPhone application that I am currently converting to a universal binary to work with the iPad. I have successfully implemented everything I need in terms of layout so that full landscape functionality is now supported in my app (previously I primarily used portrait mode to display content).

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

                  But, I have one strange problem, and it ONLY occurs in landscape mode: when I push a view controller onto the stack, it takes two taps on the back button to return to the previous view controller! The first tap shows a blank view, but with the same name on the left-side back navigation button, the second tap takes the controller back to previous view like it should.

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

                  I don't have an iPad to test, so I am relying on the simulator. The problem does not show up on the iPhone and doesn't show up if you rotate back to portrait mode.

                  我的应用由一个 tabbarcontroller 和为其 vc 加载的导航控制器组成:

                  My app consists of a tabbarcontroller with navigation controllers loaded for its vc's:

                  //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 被覆盖以在需要时自动旋转:

                  To implement landscape capability, the UITabBarController is overridden to autorotate when required:

                  //CustomTabBarController.m
                  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
                      return [[(UINavigationController *)self.selectedViewController topViewController] shouldAutorotateToInterfaceOrientation:interfaceOrientation];
                  }
                  

                  ... 工作正常.我使用这种方法导航到新视图

                  ... works fine. I navigate into new views using this method

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

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

                  Is this only a simulation error? How do I fix this problem?

                  推荐答案

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

                  It sounds like another ViewController is responding to:

                  (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
                  

                  先检查一下.

                  这篇关于UINavigationController 横向模式下的导航堆栈问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                  ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                  Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                  How to get the previous viewcontroller that pushed my current view(如何获取推送我当前视图的上一个视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                  Show UITabBar when UIViewController pushed(推送 UIViewController 时显示 UITabBar)
                      <tbody id='Qoyf4'></tbody>

                    <small id='Qoyf4'></small><noframes id='Qoyf4'>

                  • <tfoot id='Qoyf4'></tfoot>
                    • <bdo id='Qoyf4'></bdo><ul id='Qoyf4'></ul>

                      <legend id='Qoyf4'><style id='Qoyf4'><dir id='Qoyf4'><q id='Qoyf4'></q></dir></style></legend>

                      <i id='Qoyf4'><tr id='Qoyf4'><dt id='Qoyf4'><q id='Qoyf4'><span id='Qoyf4'><b id='Qoyf4'><form id='Qoyf4'><ins id='Qoyf4'></ins><ul id='Qoyf4'></ul><sub id='Qoyf4'></sub></form><legend id='Qoyf4'></legend><bdo id='Qoyf4'><pre id='Qoyf4'><center id='Qoyf4'></center></pre></bdo></b><th id='Qoyf4'></th></span></q></dt></tr></i><div id='Qoyf4'><tfoot id='Qoyf4'></tfoot><dl id='Qoyf4'><fieldset id='Qoyf4'></fieldset></dl></div>