从 AVPlayerViewController.customoverlayViewController 中删除 UIVisualEffect [英] Removing UIVisualEffect from AVPlayerViewController.customoverlayViewController
问题描述
我正在实现 AVPlayerViewController.customOverlayViewController,我想知道是否有办法删除 UIVisualEffect 并在演示文稿上应用清晰的背景.我附上 Hirechay 视图的屏幕截图.
I am implementing AVPlayerViewController.customOverlayViewController and I was wondering if there is a way to remove the UIVisualEffect and apply a clear background on the presentation. I am attaching a screenshot with the view Hirechay.
推荐答案
根据视图层次结构,ChannelViewController 是 AVxCustomOverlayHostViewController 的一部分,其 AVxHostView 类型的视图包含 UIVisualEffectView.所以:
According to the view hierarchy, the ChannelViewController is part of the AVxCustomOverlayHostViewController, and its view of type AVxHostView includes the UIVisualEffectView. So:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Remove UIVisualEffectView
if let parent = parent {
parent.view.subviews.filter({ $0 is UIVisualEffectView }).forEach({ $0.alpha = 0 })
}
}
如果你愿意,你也可以删除它.
If you want you can also remove it.
这篇关于从 AVPlayerViewController.customoverlayViewController 中删除 UIVisualEffect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!