从 AVPlayerViewController.customoverlayViewController 中删除 UIVisualEffect [英] Removing UIVisualEffect from AVPlayerViewController.customoverlayViewController

查看:29
本文介绍了从 AVPlayerViewController.customoverlayViewController 中删除 UIVisualEffect的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆