Less Blur with `Visual Effect View with Blur`?

后端 未结 11 1309
死守一世寂寞
死守一世寂寞 2020-12-08 10:11

Title pretty much asks it all...

I\'m playing with the iOS8 Visual Effect View with Blur. It\'s over a UIImageView that shows a user choosa

11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 10:59

    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.

    enter image description here

    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.

    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?

提交回复
热议问题