ios - 导航栏不出现

标签 ios xcode uinavigationcontroller

有人可以帮我解决这个问题吗? :(

导航栏没有出现。这是由 rootViewController 呈现的。

enter image description here

最佳答案

您还没有发布任何仍在猜测的代码。

只在 Storyboard中使用UINavigationController并不意味着它会默认出现。

您只是在呈现 View Controller 。您需要嵌入导航 Controller 或将 Storyboard 标识符提供给导航 Controller 并呈现。

示例:

    let yourviewController = self.storyboard?.instantiateViewController(withIdentifier: "yourVCIdentifer")

    let nav = UINavigationController(rootViewController: yourviewController)

    self.present(nav, animated: true, completion: nil)

关于ios - 导航栏不出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48759569/

相关文章:

ios - PopViewController 上的导航 Controller 变黑

ios - iOS中的App Store应用提交问题

ios - 按下编辑按钮时如何在导航栏中添加加号按钮?

ios - 检测何时询问并授予iOS通知权限?

ios - SceneKit 编辑器为节点设置自定义类

objective-c - iOS:禁用 UINavigationController

iphone - 将 leftBarButtonItem 添加到导航栏时出现问题

iOS (ObjC) PromiseKit - 在 promise 中返回 promise

xcode - 葫芦 iOS : Setting location does not work

xcode - 如何使不同的目标构建为单独的 iOS 应用程序?