<legend id='8tDL0'><style id='8tDL0'><dir id='8tDL0'><q id='8tDL0'></q></dir></style></legend>
      <tfoot id='8tDL0'></tfoot>
      <i id='8tDL0'><tr id='8tDL0'><dt id='8tDL0'><q id='8tDL0'><span id='8tDL0'><b id='8tDL0'><form id='8tDL0'><ins id='8tDL0'></ins><ul id='8tDL0'></ul><sub id='8tDL0'></sub></form><legend id='8tDL0'></legend><bdo id='8tDL0'><pre id='8tDL0'><center id='8tDL0'></center></pre></bdo></b><th id='8tDL0'></th></span></q></dt></tr></i><div id='8tDL0'><tfoot id='8tDL0'></tfoot><dl id='8tDL0'><fieldset id='8tDL0'></fieldset></dl></div>
      • <bdo id='8tDL0'></bdo><ul id='8tDL0'></ul>
      1. <small id='8tDL0'></small><noframes id='8tDL0'>

        UISplitViewController 内的 UITabBarController 内的 UINavigationC

        UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
          <tbody id='okYEu'></tbody>

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

            • <legend id='okYEu'><style id='okYEu'><dir id='okYEu'><q id='okYEu'></q></dir></style></legend>

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

                • <bdo id='okYEu'></bdo><ul id='okYEu'></ul>
                  本文介绍了UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 UISplitViewController,其中包含一个 UITabBarController 作为主视图.这个 UITabBarController 包含一个 UINavigationController.详细视图也包含一个 UINavigationController.

                  I'm having a UISplitViewController that contains a UITabBarController as master view. This UITabBarController contains a UINavigationController. The detail view contains a UINavigationController as well.

                  在 iPad 上,这可以正常工作.show detail segue 在详细视图上显示导航控制器内的图像视图.

                  On the iPad this works as expected. The show detail segue presents the imageview within the navigation controller on the detail view.

                  另一方面,在 iPhone 上,我希望 show detail segue 将详细视图推送到主视图的导航控制器的堆栈上.但实际上它是在主视图上以模态方式呈现的.

                  On the iPhone on the other hand I expected that the show detail segue pushes the detail view on the stack of the navigation controller of the master view. But actually it is presented modally over the master view.

                  当从情节提要中删除 UITabBarController 并直接在主视图中使用 UINavigationController 时,这是可行的.

                  When removing the UITabBarController from the storyboard and using the UINavigationController directly in the master view this works.

                  有人知道如何在 iPhone 上的主 UINavigationController 堆栈上显示详细视图吗?

                  Has anybody an idea how I could present the detail view on the stack of the master's UINavigationController on an iPhone?

                  推荐答案

                  我想出了如何将细节放在主人的 UINavigationController 上,而不是在 UITabBarController 上模态地呈现它.

                  I figured out how to put the detail on to the master's UINavigationController instead of presenting it modally over the UITabBarController.

                  使用 UISplitViewControllerDelegate 方法

                  - splitViewController:showDetailViewController:sender:
                  

                  如果 UISplitViewController 折叠,获取主导航控制器并将详细视图推送到此导航控制器:

                  In case the UISplitViewController is collapsed get the masters navigation controller and push the detail view onto this navigation controller:

                  - (BOOL)splitViewController:(UISplitViewController *)splitViewController
                     showDetailViewController:(UIViewController *)vc
                                       sender:(id)sender {
                      NSLog(@"UISplitViewController collapsed: %d", splitViewController.collapsed);
                  
                      // TODO: add introspection
                      if (splitViewController.collapsed) {
                          UITabBarController *master = (UITabBarController *) splitViewController.viewControllers[0];
                          UINavigationController *masterNavigationController = (UINavigationController *)master.selectedViewController;
                  
                          // push detail view on the navigation controller
                          //[masterNavigationController pushViewController:vc animated:YES];
                          // push was not always working (see discussion in answer below), use showViewController instead
                          [masterNavigationController showViewController:vc sender:sender];
                  
                          return YES;
                      }
                  
                      return NO;
                  }
                  

                  这篇关于UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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)
                  presentViewController not supporting orientation in iOS 6(presentViewController 在 iOS 6 中不支持方向)

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

                        <tbody id='VCRGy'></tbody>

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

                            <bdo id='VCRGy'></bdo><ul id='VCRGy'></ul>
                            <tfoot id='VCRGy'></tfoot>