问题描述
我最近将我的XCode更新为版本11.0.自从对一个旧项目进行更新以来,古怪的行为一直在发生.当我以模态方式选择到新页面时,该页面无法显示整个屏幕,而是看起来盘旋了.
I recently updated my XCode to version 11.0. Ever since the update segues on an old project have been behaving weirdly. When I segue modally to a new page the page does not fill the entire screen and seemingly hovers instead.
这是该视图的图片: https://imgur.com/dAxEr4q
Here is a picture of the view:https://imgur.com/dAxEr4q
我希望页面能像升级之前一样占据设备屏幕的整个长度.
I would like for the pages to take up the full length of the device screen as they did prior to the upgrade.
在此先感谢您的帮助.
推荐答案
这与iOS 13中新的默认模式表示样式有关.
要设置先前的行为,您需要将演示样式更改为全屏显示.
This has to do with the new default modal presentation style in iOS 13.
To set the prior behavior, you need to change the presentation style to full screen.
您可以在故事板上通过编辑segue的演示文稿属性并将其从自动设置为全屏:
You can do this both in storyboard by editing your segue's Presentation attribute and setting it from Automatic to Full Screen:
或者,如果您以编程方式显示View Controller,则可以在呈现它之前设置View Controllers modalPresentationStyle
,如下所示:
Alternatively, if you are presenting your View Controller programmatically, you can set your View Controllers modalPresentationStyle
before presenting it, like so:
let detailController = /* your View Controller */
detailController.modalPresentationStyle = .overFullScreen
present(detailController, animated: true, completion: nil)
这篇关于搜索后页面浏览大小不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!