<tfoot id='FHAgK'></tfoot>

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

        <legend id='FHAgK'><style id='FHAgK'><dir id='FHAgK'><q id='FHAgK'></q></dir></style></legend>
          <bdo id='FHAgK'></bdo><ul id='FHAgK'></ul>

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

        如何在 UINavigationController 的 RootViewController 上显示返回按钮?

        时间:2023-06-12
          <bdo id='8HtC9'></bdo><ul id='8HtC9'></ul>
            <tbody id='8HtC9'></tbody>
        • <i id='8HtC9'><tr id='8HtC9'><dt id='8HtC9'><q id='8HtC9'><span id='8HtC9'><b id='8HtC9'><form id='8HtC9'><ins id='8HtC9'></ins><ul id='8HtC9'></ul><sub id='8HtC9'></sub></form><legend id='8HtC9'></legend><bdo id='8HtC9'><pre id='8HtC9'><center id='8HtC9'></center></pre></bdo></b><th id='8HtC9'></th></span></q></dt></tr></i><div id='8HtC9'><tfoot id='8HtC9'></tfoot><dl id='8HtC9'><fieldset id='8HtC9'></fieldset></dl></div>

          <legend id='8HtC9'><style id='8HtC9'><dir id='8HtC9'><q id='8HtC9'></q></dir></style></legend>

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

            1. <tfoot id='8HtC9'></tfoot>

                  本文介绍了如何在 UINavigationController 的 RootViewController 上显示返回按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这是我的代码.我想在打开的 rootviewController 上放一个后退按钮.

                  - (void)selectSurah:(id)sender {SurahTableViewController * surahTableViewController = [[SurahTableViewController alloc] initWithNibName:@"SurahTableViewController" bundle:nil];surahTableViewController.navigationItem.title=@"Surah";surahTableViewController.navigationItem.backBarButtonItem.title=@"返回";UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:surahTableViewController];[自我presentModalViewController:aNavigationController动画:YES];}

                  解决方案

                  我不相信从导航堆栈中弹出根视图控制器是可能的,但你可以用 UIButton 伪造它添加为 UIBarButtonItem 的自定义视图:

                  UIButton *b = [[UIButton alloc]initWithButtonType:UIButtonTypeCustom];[b setImage:[UIImage imageNamed:@"BackImage.png"] forState:UIControlStateNormal];[b addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];self.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:b];

                  可以在这里找到合适的iOS UI元素PSD.p>

                  Here is my code. I want to put a back button on the opening rootviewController.

                  - (void)selectSurah:(id)sender {
                  
                      SurahTableViewController * surahTableViewController = [[SurahTableViewController alloc] initWithNibName:@"SurahTableViewController" bundle:nil];
                      surahTableViewController.navigationItem.title=@"Surah";
                  
                      surahTableViewController.navigationItem.backBarButtonItem.title=@"Back";
                  
                      UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:surahTableViewController];
                  
                      [self presentModalViewController:aNavigationController animated:YES];   
                  }
                  

                  解决方案

                  I don't believe it's possible to pop the root view controller off the navigation stack, but you can fake it with a UIButton added as the custom view of a UIBarButtonItem:

                  UIButton *b = [[UIButton alloc]initWithButtonType:UIButtonTypeCustom];
                  [b setImage:[UIImage imageNamed:@"BackImage.png"] forState:UIControlStateNormal];
                  [b addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];
                  self.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:b];
                  

                  A suitable PSD of iOS UI elements can be found here.

                  这篇关于如何在 UINavigationController 的 RootViewController 上显示返回按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在视图控制器之间传递数据/对象/moc - 最佳实践 下一篇:为 UIRefreshControl 提供顶部插图

                  相关文章

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

                    <legend id='B4e2k'><style id='B4e2k'><dir id='B4e2k'><q id='B4e2k'></q></dir></style></legend>

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