ios - 转到另一个 Storyboard,但导航 Controller 仍然可见

标签 ios iphone xcode swift

我有两个 Storyboard:

  1. 登录/注册目的(没有导航 View Controller )
  2. 主 Storyboard(带导航 View Controller )

当我在主 Storyboard上点击注销按钮(导航栏项目)时,我被重定向到登录 Storyboard,但仍然看到导航栏。 我怎样才能做这个 segue 并离开导航 View Controller ,这样导航栏就不会可见?

最佳答案

在这里你可以做什么,

当你想显示一个没有导航栏的登录 Controller 时,使用

        UIStoryboard * board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        LoginCntrl * cntrl = [board instantiateViewControllerWithIdentifier:@"LoginCntrl"];
        [self presentViewController:LoginCntrl animated:YES completion:^{

    }];

instantiateViewControllerWithIdentifier 方法中的 'LoginCntrl' 是 Storyboard中指定的 LoginCtrl 的标识符。 因为 presentViewController 不是导航 Controller 的一部分,所以不会在顶部显示导航栏。

关于ios - 转到另一个 Storyboard,但导航 Controller 仍然可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34849623/

相关文章:

ios - 特定用户信息的 Firebase 查询不起作用。我该如何解决这个问题?

ios - AVAudioPlayer 的属性给出 "Cannot assign result of this property"

iphone - NSForegroundColorAttributeName 在 Swift 中不起作用?

SwiftUI withAnimation 导致意外行为

iOS swift : Separate AppDelegate for XCTest

ios - 将多个二进制文件同时上传到 itunesconnect

iphone - Swift Apple Pay 崩溃; PKPaymentAuthorizationViewController = 无

iphone - 使用 CPBPressureTouchGestureRecognizer 检测点击压力强度

ios - 获取 UIViewController View 的正确边界

ios - 如何根据它的前导和尾随设置 UIImageView 的宽度?