swift - View on View 控制器在 Xcode 11 上都是方形的,怎么样?
解决方案
如果您的视图以编程方式呈现(而不是通过 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)
推荐阅读
- ios - iOS iPhone 物理屏幕尺寸(以毫米为单位)
- javascript - 画布 - 渐变闪光和遮罩
- c# - Replace DBNull with null
- javascript - 是否可以通过 JS 在不迭代元素的情况下更改 DOM 树子集的相对 url 的基础?
- android - 获取过多数据时如何摆脱冻结屏幕
- docker - 如何在谷歌云平台上运行一个大的 docker 镜像?
- iis - IIS 重写规则存储在 XML 文件中,该文件在 Web 发布时被删除
- php - 如何使用 PHP password_hash 函数对数据库中的所有密码进行哈希处理
- linq-to-sql - 如何在 LINQ 中添加新的返回类型
- asterisk - 星号 - 宏不可用