删除 UIPopoverPresentationController 后面的调光视图 [英] Remove dimming view behind UIPopoverPresentationController

查看:35
本文介绍了删除 UIPopoverPresentationController 后面的调光视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试删除使用 UIPopoverPresentationController 呈现的弹出窗口后面的调光视图.我已经实现了一个自定义的 UIPopoverBackgroundView,但似乎没有办法摆脱这种变暗的视图.

I'm trying to remove the dimming view behind a popover presented using UIPopoverPresentationController. I've implemented a custom UIPopoverBackgroundView, but there doesn't seem to be a way to get rid of this dimming view.

我已经使用视图层次结构检查器将调光视图跟踪到_UIMirrorNinePatchView",但是除了爬过 UIWindow 的子视图并手动从其超级视图中删除此视图之外,没有什么好的方法可以将其删除.这种方法存在缺陷,因为它会在调光视图被移除之前短暂闪烁.

I've tracked the dimming view to a "_UIMirrorNinePatchView" using the view hierarchy inspector, but there's no good way of removing it short of crawling through the subviews of UIWindow and manually removing this view from its superview. This approach is flawed as it briefly flashes the dimming view before it's removed.

有什么建议吗?

推荐答案

backgroundColor 属性设置为 .clear

popOverPresentationController.backgroundColor = .clear

这篇关于删除 UIPopoverPresentationController 后面的调光视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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