【问题标题】:How to get rid of UINavigationController after doing a segue to a UITabBarController in Swift?在 Swift 中对 UITabBarController 进行 segue 后如何摆脱 UINavigationController?
【发布时间】:2015-03-25 06:15:49
【问题描述】:

我基本上想在登录/注册成功后“摆脱”我为登录/注册 NavigationController 设置的 NavigationController。基本上,当按下登录/注册按钮时,我在执行一些通过 IBAction 运行的代码后进行手动搜索。我的代码运行得很好,但问题是,每当 segue 执行时,我的第二个视图控制器 TabBarController(我想在某种程度上独立于 NavigationController)仍然在视图顶部有导航栏(使用 @987654321 @ 按钮)。我正在通过 push segue 进行转换,这让我意识到这不是正确的方法,因为这意味着我将 TabBarController 嵌套到 NavigationController 本身中。只是不知道怎么让它独立。

我的方法如下:

//...After various checks/functions, inside a function, I redirect myself to the TabBarController

self.performSegueWithIdentifier("redirectToMenuFromRegistration", sender: nil)

//Where the segue "redirectToMenuFromRegistration" is my TabBarController..

正如我所说,我不希望我的 TabBarController 嵌套在我的 NavigationController 中,我希望它以某种方式独立。现在另一个问题。如果我这样做了,我还能通过 ViewControllers 传递数据吗?

非常感谢您的帮助!

干杯!

【问题讨论】:

    标签: ios iphone swift uinavigationcontroller uitabbarcontroller


    【解决方案1】:

    在情节提要中将 segue “Show” 设置为 “Present Modally”。

    【讨论】:

    • 解决了我的问题!!感谢您的帮助!
    猜你喜欢
    • 1970-01-01
    • 2015-04-18
    • 2018-07-24
    • 1970-01-01
    • 1970-01-01
    • 2011-08-20
    • 1970-01-01
    • 2015-06-20
    • 1970-01-01
    相关资源
    最近更新 更多