简体   繁体   English

segue后如何修复新的视图显示?

[英]How to fix new view display after segue?

I just recently started coding again after about four months.大约四个月后,我最近才重新开始编码。 There were a few updates in between.中间有一些更新。 When I went to work on my app I clicked on a link and noticed the new view was hovering over the last view and there was no status bar.当我开始开发我的应用程序时,我单击了一个链接,发现新视图悬停在最后一个视图上,并且没有状态栏。 Just wanted to know what is causing this to happen and how to fix?只是想知道导致这种情况发生的原因以及如何解决? Thanks谢谢

在此处输入图像描述

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 changed the way view controllers are presented by default. iOS 13 更改了默认显示视图控制器的方式。 If you are using something like parentViewController.show(childViewController, sender: self) In iOS 12 the child view controller used to be shown full screen.如果您使用类似parentViewController.show(childViewController, sender: self)在 iOS 12 中,子视图 controller 曾经全屏显示。 In iOS 13 it shows up hovering over its parent.在 iOS 13 中,它显示为悬停在其父级上。

To make it show up full screen, you need to add one line above the show() : childViewController.modalPresentationStyle =.fullScreen .要使其全屏显示,您需要在show()上方添加一行: childViewController.modalPresentationStyle =.fullScreen

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM