【问题标题】:Show tab bar on modal View在模态视图上显示标签栏
【发布时间】:2015-10-29 12:11:05
【问题描述】:


点击按钮“开始!”显示白色视图控制器。
我想在白色 ViewController 上显示标签栏,但它没有显示。我如何正确地做到这一点?请速速,谢谢。

【问题讨论】:

    标签: ios xcode swift storyboard uitabbarcontroller


    【解决方案1】:

    您必须使用导航控制器才能看到标签栏。通过模态呈现,您无法在白色控制器中获得标签栏。

    Swift 代码:

    let secondViewController = self.storyboard.instantiateViewControllerWithIdentifier("SecondViewController") as SecondViewController
    
    self.navigationController.pushViewController(secondViewController, animated: true)  
    

    【讨论】:

    • 在 Go 按钮操作方法中。确保您在界面构建器(白色视图控制器)中放置了正确的故事板 ID。
    【解决方案2】:

    我认为你使用了错误的 segue,只需按 control 键 删除旧的 segue 并添加新的 segue:

    【讨论】:

    • 这样做但标签栏不可见(
    • 阅读本教程了解更多信息:makeapppie.com/2014/09/09/…
    • 按照我建议的教程,它会对你有所帮助。
    【解决方案3】:

    在firstView中这样做,所以firstViewController嵌入到NavigationController中,然后进行push segue,tabBar不会关闭。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多