<bdo id='XmVRh'></bdo><ul id='XmVRh'></ul>
      <tfoot id='XmVRh'></tfoot>

      1. <small id='XmVRh'></small><noframes id='XmVRh'>

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

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

        无需返回按钮即可推送到 ViewController

        时间:2023-06-10
          1. <small id='2Mv5A'></small><noframes id='2Mv5A'>

          2. <legend id='2Mv5A'><style id='2Mv5A'><dir id='2Mv5A'><q id='2Mv5A'></q></dir></style></legend>

                <bdo id='2Mv5A'></bdo><ul id='2Mv5A'></ul>
                <tfoot id='2Mv5A'></tfoot>
                  <tbody id='2Mv5A'></tbody>
                  <i id='2Mv5A'><tr id='2Mv5A'><dt id='2Mv5A'><q id='2Mv5A'><span id='2Mv5A'><b id='2Mv5A'><form id='2Mv5A'><ins id='2Mv5A'></ins><ul id='2Mv5A'></ul><sub id='2Mv5A'></sub></form><legend id='2Mv5A'></legend><bdo id='2Mv5A'><pre id='2Mv5A'><center id='2Mv5A'></center></pre></bdo></b><th id='2Mv5A'></th></span></q></dt></tr></i><div id='2Mv5A'><tfoot id='2Mv5A'></tfoot><dl id='2Mv5A'><fieldset id='2Mv5A'></fieldset></dl></div>
                  本文介绍了无需返回按钮即可推送到 ViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在开发一个包含登录/身份验证功能的 iOS 应用程序 - 基本上是用户第一次登录时,他们需要输入相关的登录详细信息 - 然后它们被传递到主应用程序屏幕 - 后续访问应用程序时,它们将自动已通过身份验证.

                  I am developing an iOS app which contains login/authentication functionality - basically first time a user logins, in they need to enter relevant login details - then they are passed to main app screens - subsequent visits to the app they will be automatically authenticated.

                  以上所有内容都可以正常工作-我遇到的问题是导航栏-它出现在应用程序主要部分的主屏幕中并带有后退按钮-我不希望显示它,因为它们不应该显示验证后能够返回登录屏幕.我猜它使用了解释逻辑的根导航控制器,但是有没有办法忽略登录部分的导航控制器,所以后退按钮不会显示在主应用程序中.

                  All above works fine - the issue I have is with the Navigation bar - it appears in the main screen in the main part of the app with a back button - I don't want this to be displayed as they should not be able to return to the login screen once authenticated. I guess it's using the root navigation controller which explains the logic, but is there a way to ignore the navigation controller of the login section so the back button is not displayed in the main app.

                  下面是结构的屏幕截图以帮助我解释 - 左侧的屏幕组是登录过程,右侧是主要的应用程序结构.

                  Below is a screenshot of the structure to help my explanation - left hand group of screens are the login process right hand is the main app structure.

                  用于切换画面的代码如下——

                  The code used to switch screens is as follows -

                  SWRevealViewController *swRevealController = (SWRevealViewController *)navVC;
                  swRevealController.managedObjectContext = self.managedObjectContext;
                  [self.navigationController pushViewController:controller animated:YES];
                  

                  推荐答案

                  在登录后实现的Screen中,ViewDidLoad方法添加一行隐藏后退栏按钮.

                  In the Screen which implements after login, the ViewDidLoad method add the line to hide back bar button.

                  self.navigationItem.hidesBackButton = YES;
                  

                  此外,您可以添加一个注销"选项

                  Additionally you can add an 'Logout' option as

                  UIBarButtonItem *backBarButton = [[UIBarButtonItem alloc] initWithTitle:@"Logout" style:UIBarButtonItemStyleBordered
                                                                                   target:self
                                                                                   action:@selector(LogoutClick)];
                  self.navigationItem.leftBarButtonItem = backBarButton;
                  
                  -(void)LogoutClick {
                      [self showLogoutAlert];
                  }
                  
                  -(void)showLogoutAlert {
                  
                      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
                                                                  message:@"Do you want to Logout ?"
                                                                         delegate:self
                                                                cancelButtonTitle:@"Cancel"
                                                                otherButtonTitles:@"Logout", nil];
                      [alert show];
                  }
                  
                  
                  - (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
                  
                      if (buttonIndex == 1) {
                          [self.navigationController popToRootViewControllerAnimated:YES];
                      }
                  }
                  

                  这篇关于无需返回按钮即可推送到 ViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:导航栏中带有返回按钮的 UISegmentedControl 下一篇:NavigationItem iOS 11 Apple 方式中的 UISearchController

                  相关文章

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

                • <tfoot id='DlW11'></tfoot>

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

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