<legend id='0LgAI'><style id='0LgAI'><dir id='0LgAI'><q id='0LgAI'></q></dir></style></legend>

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

      <small id='0LgAI'></small><noframes id='0LgAI'>

        <bdo id='0LgAI'></bdo><ul id='0LgAI'></ul>

        <tfoot id='0LgAI'></tfoot>

        将嵌套在容器视图控制器中的 UINavigationController 添加到 UITabBarController

        时间:2023-06-11
        <legend id='DoPQL'><style id='DoPQL'><dir id='DoPQL'><q id='DoPQL'></q></dir></style></legend>
            <tbody id='DoPQL'></tbody>
          <tfoot id='DoPQL'></tfoot>

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

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

                • <bdo id='DoPQL'></bdo><ul id='DoPQL'></ul>
                  本文介绍了将嵌套在容器视图控制器中的 UINavigationController 添加到 UITabBarController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 UIViewController(红色)设置为 UITabBarController 的第一个选项卡,如下面的故事板所示.这个视图控制器是一个容器视图控制器,并在它的 contentView(红色视图控制器内的白色矩形)内加载了一个 UINavigationController.

                  I have a UIViewController (red) set as the first tab of a UITabBarController as shown in the storyboard below. This view controller is a container view controller and loads a UINavigationController inside its contentView (the white rectangle inside the red view controller).

                  这是我在红色视图控制器的 contentView 中加载导航控制器的代码:

                  This is my code for loading the navigation controller inside the red view controller's contentView:

                  - (void)viewDidLoad
                  {
                      [super viewDidLoad];
                  
                      // instantiate navigation controller
                      UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
                      UINavigationController *navigationVC = [storyboard instantiateViewControllerWithIdentifier:@"N"];
                  
                      // place navigation controller inside content view
                      [self addChildViewController:navigationVC];
                      navigationVC.view.frame = self.containerView.bounds;
                      [self.containerView addSubview:navigationVC.view];
                      [navigationVC didMoveToParentViewController:self];
                  }
                  

                  根据我对视图控制器包含的了解,这应该工作,因为我明确设置导航控制器的框架.但是,当 tableView 中有足够的单元格超过容器的高度时,当我向下滚动时,tableView 的末尾总会有一个栏.我已将 tableViewbackgroundColor 设置为 orange 并将单元格的 backgroundColor 设置为 white 为了看到差异.

                  From what I know about view controller containment this should work as I am explicitly setting the frame for the navigation controller. However, when there are enough cells in the tableView to exceed the container's height there is always a bar at the end of the tableView when I scroll down. I have set the tableView's backgroundColor to orange and the cell's backgroundColor to white in order to see the difference.

                  如何消除 tableView 末尾的橙色间隙?

                  How do I get rid of that orange gap at the end of the tableView?

                  (注意:我使用自动布局,我需要一个同时适用于 iOS7 iOS6的解决方案.)

                  (Note: I am not using autolayout and I need a solution that works for both - iOS7 and iOS6.)

                  推荐答案

                  我知道您也在寻找适用于 iOS 6 的答案,但在 iOS 7 及更高版本上您可以使用

                  I know you are also looking for an answer which works on iOS 6, but on iOS 7 and above you can use

                  self.extendedLayoutIncludesOpaqueBars = YES;
                  

                  这篇关于将嵌套在容器视图控制器中的 UINavigationController 添加到 UITabBarController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iphone navigationController : 在退出当前视图之前等待 uialertview 响应 下一篇:如何从屏幕顶部为表格视图控制器显示 UISearchBar

                  相关文章

                • <legend id='B2NSL'><style id='B2NSL'><dir id='B2NSL'><q id='B2NSL'></q></dir></style></legend>
                      • <bdo id='B2NSL'></bdo><ul id='B2NSL'></ul>
                    1. <tfoot id='B2NSL'></tfoot>

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

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