[英]iOS 13 UIViewController modal presentation shadow
更新:經過進一步調查,這似乎不是可以改變的。 It's a private UIKit View setup by iOS and is a new addition in iOS 13. See 19:50 at https://developer.apple.com/videos/play/wwdc2019/224/
對於我自己的應用程序/游戲,我將尋求創建一個自定義 UIModalPresentationStyle 來實現我想要的外觀。
您還可以通過簡單地呈現 as.fullScreen 或其他呈現樣式而不是這種新的工作表方法來緩解這種情況。
我有你的解決方案
extension UIViewController {
func removeBackgroundForParents() {
var superview = view.superview
while superview != nil {
superview?.layer.backgroundColor = UIColor.clear.cgColor
superview?.layer.shadowColor = UIColor.clear.cgColor
superview = superview?.superview
}
}
}
並在您的視圖中使用它 controller。
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
removeBackgroundForParents()
}
您無法從默認模式演示文稿中刪除陰影。 但是您可以自由地編寫自己的自定義過渡 animation 和自定義演示 controller,在這種情況下,是否插入陰影視圖(調光視圖)取決於您。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.