<tfoot id='zZhLG'></tfoot>
  • <legend id='zZhLG'><style id='zZhLG'><dir id='zZhLG'><q id='zZhLG'></q></dir></style></legend>

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

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

        • <bdo id='zZhLG'></bdo><ul id='zZhLG'></ul>

        故事板导航控制器和标签栏控制器

        Storyboard navigation controller and tab bar controller(故事板导航控制器和标签栏控制器)

          <legend id='9v7BS'><style id='9v7BS'><dir id='9v7BS'><q id='9v7BS'></q></dir></style></legend>
          <tfoot id='9v7BS'></tfoot>

            <small id='9v7BS'></small><noframes id='9v7BS'>

            • <bdo id='9v7BS'></bdo><ul id='9v7BS'></ul>
                    <tbody id='9v7BS'></tbody>
                • <i id='9v7BS'><tr id='9v7BS'><dt id='9v7BS'><q id='9v7BS'><span id='9v7BS'><b id='9v7BS'><form id='9v7BS'><ins id='9v7BS'></ins><ul id='9v7BS'></ul><sub id='9v7BS'></sub></form><legend id='9v7BS'></legend><bdo id='9v7BS'><pre id='9v7BS'><center id='9v7BS'></center></pre></bdo></b><th id='9v7BS'></th></span></q></dt></tr></i><div id='9v7BS'><tfoot id='9v7BS'></tfoot><dl id='9v7BS'><fieldset id='9v7BS'></fieldset></dl></div>
                  本文介绍了故事板导航控制器和标签栏控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 Storyboard 中进行以下设置.

                  I am trying to get the following setup in Storyboard.

                  一开始我有一个表格视图,当我点击一个单元格时,它需要转换到标签栏控制器,这很有效.但现在我想在最右边的 2 个控制器中添加一个标题和一个额外的导航栏按钮.

                  Where I have a table view in the beginning, and when I tap a cell it needs to transition to the tab bar controller, which works. But now I want a title and an extra navigation bar button in the the 2 most right controllers.

                  但我似乎无法将按钮拖到那里,或者在设置标题时,什么也没有显示.如何在情节提要中实现此设置?

                  But I can't seem to drag a button to there or when setting the title, nothing shows up. How can I achieve this setup in storyboard?

                  根据以下答案更新问题.

                  Updated question, based on answer below.

                  当我有了这个新设置时(因此中间有一个额外的导航控制器),我可以在情节提要中设置标题,但是在运行应用程序时,添加的标题不会显示.

                  When I have this new setup (thus with an extra navigation controller in between) I can set the title in the storyboard, but when running the app, the added title is not shown.

                  我已上传一个具有该设置的 Xcode 项目.也许它可以派上用场.

                  I have uploaded a Xcode project with exactly that setup. Perhaps it can come in handy.

                  推荐答案

                  为了改变 UINavigationBar 标题(不需要创建另外 2 个 UINavigationController)你可以使用

                  For changing the UINavigationBar title (with no need to create 2 other UINavigationController) you can just use

                  [self.parentViewController.navigationItem setTitle:@"Title"];
                  

                  添加右键使用

                  self.parentViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(myRightButton)];
                  

                  关于从 UITabBarController 引用的每个 UIViewControllerviewDidLoad 方法.

                  on viewDidLoad method for each UIViewController referenced from your UITabBarController.

                  如果您想在 TabItemsUIViewController 中使用导航结构",则可以将 BUFViewController.m 编辑为:

                  If you want to work with "navigation structures" inside your UIViewController from TabItems so you could edit your BUFViewController.m to that:

                  #import "BUFViewController.h"
                  
                  @interface BUFViewController ()
                  
                  @end
                  
                  @implementation BUFViewController
                  
                  - (void)viewDidLoad
                  {
                      [super viewDidLoad];
                      // Do any additional setup after loading the view, typically from a nib.
                      [self.parentViewController.navigationController setNavigationBarHidden:YES];
                      self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done)];
                  }
                  
                  -(void)done{
                      [self.parentViewController.navigationController popToRootViewControllerAnimated:YES];
                  }
                  
                  - (void)didReceiveMemoryWarning
                  {
                      [super didReceiveMemoryWarning];
                      // Dispose of any resources that can be recreated.
                  }
                  
                  @end
                  

                  你必须认为你的 UITabBarController 在你的父 NavigationController 中,所以你想隐藏父 UINavigationBar 并显示你的.之后,您将能够在父级的 UINavigationController 上使用 popToRootViewControllerAnimated: 返回您的表.

                  You have to think as your UITabBarController is inside your parent NavigationController, so you want to hide the parent UINavigationBar and show yours. After that, you'll be able to back to your table using popToRootViewControllerAnimated: on the parent's 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 add a navigation controller programmatically in code but not as initial view controller(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                  View being blocked by UITransitionView after being presented(呈现后被 UITransitionView 阻止的视图)
                • <i id='JMdft'><tr id='JMdft'><dt id='JMdft'><q id='JMdft'><span id='JMdft'><b id='JMdft'><form id='JMdft'><ins id='JMdft'></ins><ul id='JMdft'></ul><sub id='JMdft'></sub></form><legend id='JMdft'></legend><bdo id='JMdft'><pre id='JMdft'><center id='JMdft'></center></pre></bdo></b><th id='JMdft'></th></span></q></dt></tr></i><div id='JMdft'><tfoot id='JMdft'></tfoot><dl id='JMdft'><fieldset id='JMdft'></fieldset></dl></div>
                    <bdo id='JMdft'></bdo><ul id='JMdft'></ul>

                      <tbody id='JMdft'></tbody>

                  • <small id='JMdft'></small><noframes id='JMdft'>

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

                      <tfoot id='JMdft'></tfoot>