使用“模糊视觉效果视图”减少模糊? [英] Less Blur with `Visual Effect View with Blur`?

查看:172
本文介绍了使用“模糊视觉效果视图”减少模糊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题几乎要求所有...

Title pretty much asks it all...

我正在玩iOS8 带有模糊的视觉效果视图。它超过 UIImageView ,显示用户可选择的背景照片。放置在contentView本身的视图是我自己的自定义视图,显示了一种图形/日历。大多数所述日历图是透明的。适用于背后照片的模糊非常沉重。我想让更多细节泄漏。但Apple似乎只提供三个罐装值:

I'm playing with the iOS8 Visual Effect View with Blur. It's over a UIImageView that shows a user choosable background photo. The view placed in the contentView itself is my own custom view, shows a sort of graph/calendar. Most of said calendar graph is transparent. The blur it applies to the photo behind it is really heavy. I'd like to let more of the detail leak through. But Apple only seems to give three canned values:

typedef enum {
    UIBlurEffectStyleExtraLight,
    UIBlurEffectStyleLight,
    UIBlurEffectStyleDark 
} UIBlurEffectStyle;

我用 UIVisualEffectView <的不同alpha和背景颜色逛了一圈/ code>(即使文档警告过这一点),但这并没有做任何事情,只会让情况变得更糟。

I've monkied around with different alphas and background colors of the UIVisualEffectView (even though the documentation warns against that), but that doesn't do anything but make it worse.

推荐答案

模糊效果样式会影响图像的亮度级别,而不会影响应用的模糊量。

The reason you're getting heavy blur is that the blur effect style affects the brightness level of the image, not the amount of blur applied.

不幸的是,尽管Apple显然能够以编程方式控制模糊量 - 尝试在启动板上慢慢拖动以观察Spotlight模糊过渡 - 我看不到任何公开用于将模糊量传递给 UIBlurEffect 的API。

Unfortunately, although Apple clearly has the ability to control the amount of blur applied programmatically--try dragging down slowly on the launchpad to watch the Spotlight blurring transition--I don't see any public API to pass a blur amount to UIBlurEffect.

此帖子声称调整背景颜色alpha会驱动模糊量。值得一试,但我没有看到记录的位置:如何淡化UIVisualEffectView和/或UIBlurEffect进出?

This post claims that adjusting the background color alpha will drive the blur amount. It's worth a try, but I don't see where that is documented: How to fade a UIVisualEffectView and/or UIBlurEffect in and out?

这篇关于使用“模糊视觉效果视图”减少模糊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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