gpt4 book ai didi

ios - 呈现 View 时导航栏不出现?

转载 作者:可可西里 更新时间:2023-11-01 00:56:31 26 4
gpt4 key购买 nike

选择这行代码时不出现导航栏

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

但是当尝试这段代码时

let vc = storyboard.instantiateViewController(withIdentifier: "view")
let navController = UINavigationController(rootViewController: vc)
self.present(vc, animated: true, completion: nil)

我的应用程序崩溃,出现错误

NSInvalidArgumentException', reason: 'Application tried to present modally an active controller 

请帮助我在呈现 View 而不是推送 View 时获取导航栏

最佳答案

尝试这样做 -

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

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

26 4 0