<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 上显示返回按钮?

        How to show back button on the RootViewController of the UINavigationController?(如何在 UINavigationController 的 RootViewController 上显示返回按钮?)
          <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 上显示返回按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                  How to get the previous viewcontroller that pushed my current view(如何获取推送我当前视图的上一个视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)

                    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>
                        <tbody id='B4e2k'></tbody>
                      <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'>