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