第二个ViewController在顶部有这个空间,它几乎在手机上显示为一个可忽略的弹出窗口。如何制作全屏(去掉用橙色箭头指向的空格)?

发布于 2019-09-23 18:47:07
这是对iOS 13的更改。用户将开始期望能够刷走模态,因此可能值得考虑支持这一点。
如果您真的打算使用旧的演示样式,可以在演示之前设置演示的viewController的modalPresentationStyle:
vc.modalPresentationStyle = .fullScreen或者在视图控制器本身中覆盖它:
override var modalPresentationStyle: UIModalPresentationStyle {
get { .fullScreen }
set { assertionFailure("Shouldnt change that ?") }
}或设置在故事板片段中:

发布于 2019-09-30 00:46:01
遇到了同样的问题。覆盖UIViewController实现中的prepare for segue。将navigationController.modalPresentationStyle设置为.fullScreen
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the presented navigationController and the view controller it contains
let navigationController = segue.destination
navigationController.modalPresentationStyle = .fullScreen
}https://stackoverflow.com/questions/58060607
复制相似问题