我有一个应用程序,我需要在每次打开该应用程序时显示 PIN 码屏幕。我成功显示了模态视图,但它没有覆盖顶部的导航栏,也没有覆盖底部的标签栏。我相信这是因为我的呈现方式,但我没有看到改变它的方法。
这就是我展示 Controller 的方式
let newVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LoginView")
let view = window?.rootViewController as! UITabBarController
view.selectedViewController?.show(newVC, sender: nil)
最佳答案
问题是您使用了UIViewController 的
api,show .在这种情况下,该函数被 UINavigationController
覆盖,push
将用于呈现 View Controller 。如果您的计划是模态呈现 View Controller ,请使用 present
selectedViewController?.present(newVC, animated: true, completion: nil)
关于ios - 模态视图不覆盖整个屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49580654/