简体   繁体   English

Swift 4.2 Segues:ViewControllers 堆叠而不是替换?

[英]Swift 4.2 Segues: ViewControllers Stacking Instead of Replacing?

Pretty simple problem - now that I'm using Swift 4.2, my segues are "stacking" the view controllers physically.非常简单的问题 - 现在我使用的是 Swift 4.2,我的 segue 正在物理上“堆叠”视图控制器。 When I segue, the new view controller is not brought to the top of the screen and can be dragged down to go to the view controller before it.当我继续时,新的视图控制器不会被带到屏幕顶部,可以向下拖动以转到它之前的视图控制器。 When I segue, I want the previous view controller to be entirely covered by the new one.当我继续时,我希望以前的视图控制器完全被新的视图控制器覆盖。 How do I achieve this?我如何实现这一目标? Am I forced to use a navigation controller now?我现在被迫使用导航控制器吗?

What you are seeing is a change in the default modal presentation style for iOS 13. There are different possible ways to address it depending on your intent.您所看到的是 iOS 13 的默认模态呈现样式的更改。根据您的意图,有多种可能的方法来解决它。 These question and answers cover those possibilities:这些问题和答案涵盖了这些可能性:

Presenting modal in iOS 13 fullscreen 在 iOS 13 全屏显示模式

change the presentation style改变演示风格

for example例如

 let VC1 = self.storyboard!.instantiateViewController(withIdentifier: "sideMenu")
 VC1.modalPresentationStyle = .fullScreen
 self[![enter image description here][1]][1].present(VC1, animated: true, completion: nil)

or if you are using storyboard, check the segue properties或者如果您使用的是故事板,请检查 segue 属性

转场属性

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

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