<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. 根据选择的选项卡更改导航栏的标题?

      时间:2023-06-11
        <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 等也是如此.

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

                上一篇:在“返回"旁边添加另一个按钮UINavigationBar 左侧的按钮 下一篇:在许多 UIVIewControllers 之间传递一个变量

                相关文章

                <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>
                  <bdo id='4OF11'></bdo><ul id='4OF11'></ul>
              2. <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'>