<bdo id='8tQcO'></bdo><ul id='8tQcO'></ul>

    1. <legend id='8tQcO'><style id='8tQcO'><dir id='8tQcO'><q id='8tQcO'></q></dir></style></legend>
      <tfoot id='8tQcO'></tfoot>

      <small id='8tQcO'></small><noframes id='8tQcO'>

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

    2. 根据选择的选项卡更改导航栏的标题?

      Change title of navbar based on which tab is selected?(根据选择的选项卡更改导航栏的标题?)
        <bdo id='LFNss'></bdo><ul id='LFNss'></ul>

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

              <tbody id='LFNss'></tbody>
              <tfoot id='LFNss'></tfoot>

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

              1. 本文介绍了根据选择的选项卡更改导航栏的标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个 iOS 应用程序,其中有一个导航控制器作为根控制器,但有一个选项卡栏可以在其中一个导航栏中的视图之间进行选择.它看起来类似于 iTunes 应用程序(顶部的导航栏,底部的标签栏).我希望导航栏的标题根据选择的选项卡进行更改.每个选项卡都有两个单独的控制器文件.以下是我迄今为止尝试使用的方法来解决此问题,但无济于事:

                I have an iOS app where there is a navigation controller as the root controller but at one part there is a tab bar to select between views in one of the nav bars. It looks similar to the iTunes app (navigation bar on top, tab bar on the bottom). I want the title of my navigation bar to change based on which tab is selected. I have two separate controller files for each tab. Here is what I have tried to use in each so far to fix this to no avail:

                self.navigationItem.title = @"Title";
                self.navigationController.navigationItem.title = @"title";
                [self.navigationController setTitle:@"Live"];    
                [self setTitle:@"Top Title"];
                

                如何根据按下的选项卡更改导航栏标题?

                How do I change the NavBar title based on which tab is pressed?

                推荐答案

                您在当前显示的视图控制器中更改栏的标题.

                You change the title of the bar in the view controller that is currently being displayed.

                因此,例如,在您在选项卡控制器中显示的视图控制器 A 中,您可以添加:

                So for example, in view controller A that you're showing in the tab controller, you might add:

                - (void)viewWillAppear:(BOOL)animated {
                    [super viewWillAppear:YES];
                    [self setTitle:@"A"];
                    self.tabBarController.navigationItem.title = @"A";
                }
                

                B、C 等也是如此.

                这篇关于根据选择的选项卡更改导航栏的标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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='4OF11'><tr id='4OF11'><dt id='4OF11'><q id='4OF11'><span id='4OF11'><b id='4OF11'><form id='4OF11'><ins id='4OF11'></ins><ul id='4OF11'></ul><sub id='4OF11'></sub></form><legend id='4OF11'></legend><bdo id='4OF11'><pre id='4OF11'><center id='4OF11'></center></pre></bdo></b><th id='4OF11'></th></span></q></dt></tr></i><div id='4OF11'><tfoot id='4OF11'></tfoot><dl id='4OF11'><fieldset id='4OF11'></fieldset></dl></div>
                  <tbody id='4OF11'></tbody>
                  <bdo id='4OF11'></bdo><ul id='4OF11'></ul>
                  • <tfoot id='4OF11'></tfoot>
                        <legend id='4OF11'><style id='4OF11'><dir id='4OF11'><q id='4OF11'></q></dir></style></legend>

                        <small id='4OF11'></small><noframes id='4OF11'>