Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS can't set background color for FXBlurView

Tags:

ios

uiview

blur

I'm using FXBlur to achieve blur-effect for an underlying view. But the background color which I set is never seen while running.

I have a "Main View" inside which there is an Image and a Blur View. Blur View has a grey background.

The Image is getting blurred but I can't see the grey color which I had set for the Blur View. No matter what I try, I can't set the backgrund color and achieve the blur effect simultaneously.

What might be the issue? Is there any workaround?

EDITED :

self.blurView.dynamic = NO;
self.blurView.tintColor = [UIColor grayColor];
self.blurView.contentMode = UIViewContentModeBottom;
like image 696
Sreejith Avatar asked Apr 01 '14 17:04

Sreejith


1 Answers

The blurView tintColor uses additive blending, so making it grey won't have much effect.

If you want to add a grey overlay to darken your blur view, add a subview with a partially transparent grey backgroundColor inside the blurView.

like image 157
Nick Lockwood Avatar answered Oct 19 '22 23:10

Nick Lockwood