我最近将我的 XCode 更新到版本 11.0。自从更新旧项目以来,segues 一直表现得很奇怪。当我以模态方式切换到新页面时,该页面不会填满整个屏幕,而是看似悬停。
这是 View 的图片: https://imgur.com/dAxEr4q
我希望页面能够像升级之前一样占据设备屏幕的整个长度。
预先感谢您的帮助。
最佳答案
这与 iOS 13 中新的默认模式呈现样式有关。
要设置先前的行为,您需要将演示样式更改为全屏。
您可以在 Storyboard 中执行此操作,方法是编辑segue的演示属性并将其从自动设置为全屏:
或者,如果您以编程方式呈现 View Controller ,则可以在呈现之前设置 View Controller modalPresentationStyle
,如下所示:
let detailController = /* your View Controller */
detailController.modalPresentationStyle = .overFullScreen
present(detailController, animated: true, completion: nil)
关于ios - Segue 后页面 View 大小不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58116642/