简体   繁体   中英

How do I regulate the level of UIVisualEffectView blur

I'm trying to make a UIVisualEffectView to make a nice blur effect in my view. But I think that the UIVisualEffectView generates a very strong blur.

I'm trying to regulate a level of blur to my UIVisualEffectView, I want a weak blur.

Do you know how to do that?

You can't do this with a UIVisualEffectView - the only options for blur are:

enum UIBlurEffectStyle : Int {
    case ExtraLight
    case Light
    case Dark
}

There's no property on UIBlurEffect , UIVisualEffect , or UIVisualEffectView for 'magnitude' of the blur.

This blog post is a good place to start if you want to 'roll your own' blur view with a custom magnitude.

Also you can use UIImage+ImageEffects.h category from WWDC 2013. It has more stuff to tune

eg from https://github.com/ParsePlatform/Anypic/tree/master/Anypic-iOS/Vendor/UIImageEffects

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM