[英]View on View controllers are all square shaped on Xcode 11, how?
在 iOS 13 上,默认情况下,“模态”转场会以这种方式显示呈现控制器。
如果您希望视图控制器占据整个屏幕,请在进入该控制器的任何 segue 的“演示”设置上设置“全屏”。 转场设置
如果您的视图以编程方式呈现(不是通过 storyBoard),请记住这一点:从 XCode 11 及更高版本开始,当您为 iPad 构建时,您必须添加“modalPresentationStyle = .fullScreen”以获得全屏视图,而不是方形视图。 如下:
let vc = UIViewController()
vc.modalPresentationStyle = .fullScreen
self.present(vc, animated: true, completion: nil)
如果你想在新的 viewController 上透明,你可以写“.overFullScreen”,如下:
let vc = UIViewController()
vc.modalPresentationStyle = .overFullScreen
self.present(vc, animated: true, completion: nil)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.