在MAAttachedWindow后面有模糊背景吗? [英] Blur background behind MAAttachedWindow?

查看:111
本文介绍了在MAAttachedWindow后面有模糊背景吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是好奇,如果这是可能的。现在这里是一个示例 MAAttachedWindow 如下所示:

Just curious if this is possible. Right now here is what a sample MAAttachedWindow looks like:

但是,我想知道是否可以模糊窗口后面的背景,例如:

However, I want to know if I can blur the background behind the window, like this:

>

这是否可以不使用私人API?

Is this possible without using private APIs?

请求代码。那么,这里是如何MAAttachedWindow工作。你只需要给它一个自定义NSView,它做剩下的。所以,这里是我想要使模糊:

Request for code. Well, here's how MAAttachedWindow works. You just feed it a custom NSView, and it does the rest. So, here's how I was trying to make the blur:

CALayer *backgroundLayer = [CALayer layer];
[view setLayer:backgroundLayer];
[view setWantsLayer:YES];
CIFilter *blurFilter = [CIFilter filterWithName:@"CIGaussianBlur"];
[blurFilter setDefaults];
[view layer].backgroundFilters = [NSArray arrayWithObject:blurFilter];


推荐答案

否。你不能这样做,而不使用私人API。 (我的邮件长度是否为30个字符?)

No. You can’t do this without using private APIs. (Is my message 30 characters long yet?)

这篇关于在MAAttachedWindow后面有模糊背景吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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