ios - 如何修复segue后新 View 的显示?

标签 ios swift3 segue

大约四个月后,我最近才重新开始编码。中间有一些更新。当我开始处理我的应用程序时,我点击了一个链接,发现新 View 悬停在上一个 View 上,并且没有状态栏。只是想知道导致这种情况发生的原因以及如何解决?谢谢

enter image description here

self.performSegue(withIdentifier: "Recover=>SignIn", sender: self)




override func prepare(for segue: UIStoryboardSegue, sender: Any!) {

if(segue.identifier == "Recover=>Connection") {

let navController = segue.destination as! UINavigationController

_ = navController.topViewController as! Connection

}

}

最佳答案

iOS 13 更改了 View Controller 的默认呈现方式。如果您使用类似的东西 parentViewController.show(childViewController, sender: self) 在 iOS 12 中, subview Controller 曾经全屏显示。在 iOS 13 中,它会悬停在其父项上。

要使其全屏显示,您需要在show() 上方添加一行: childViewController.modalPresentationStyle = .fullScreen

关于ios - 如何修复segue后新 View 的显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58783090/

相关文章:

ios - 左镜像照片的缩略图方向错误

swift - 等待任务完成

操作系统。 URL 中的屏蔽符号

iphone - 如何检测 View Controller 何时被关闭?

iphone - 是否可以用图案图像填充 UIBezierPath?

ios - "unsafeMutableAddressor : Swift.String",从 :. 引用。”

ios - 用于两指手势的自定义 UIGestureRecognizer

ios - sectionForSectionIndexTitle 和 sectionIndexTitlesForTableView 未在 swift 3 中调用

swift - 如何在 UITableViewCell 类中使用prepare for segue

ios - 如何从父 View Controller 检测容器 View 中的焦点 UITextField