[英]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.