FXBlurView icon indicating copy to clipboard operation
FXBlurView copied to clipboard

Blurview coming as a black color in ios7

Open sourcebits-mahesh opened this issue 10 years ago • 12 comments

I created blur view(FXBlur View) for the uiview it is coming nicely but whenever uiview had background color as a clear color ,blurview coming as a black color .Please look the attachment what i was to say exactly ! Blur view applies for the behind view having clear color has a background color showing as black color

screen shot 2014-05-12 at 1 57 25 pm

sourcebits-mahesh avatar May 12 '14 08:05 sourcebits-mahesh

Yes, that's expected behaviour. FXBlurView only captures the contents of the view itself, not any colours showing through from the view behind.

If you set the underlyingView property of the FXBlurView to the view that contains your partially transparent view, it should solve the problem.

nicklockwood avatar May 12 '14 09:05 nicklockwood

Hello please can you expand on

If you set the underlyingView property of the FXBlurView to the view that contains your partially transparent view, it should solve the problem.

Does this mean that I should set the classes of the views below the view I want to be blurred as FXBlurView ? As I currently have two views below my view that I want blurred as I have explained here.

Also is there a way to make the default "error color" white instead of black?

maxmitch avatar Jul 10 '14 10:07 maxmitch

No. The FXBlurView has a property called "underlyingView". If this is nil, it defaults to the view containing the FXBlurView, however you can set this to a view of your choosing, including views that are not in the same hierarchy as the blur view.

nicklockwood avatar Jul 10 '14 12:07 nicklockwood

Oh Okay! How do you asign the property "underlyingView"? to a UIView in leymans terms?

maxmitch avatar Jul 10 '14 13:07 maxmitch

It's just a property of the FXBlurView class. If you have an outlet to your blurView in your view controller, you'd just write:

self.myBlurView.underlyingView = someOtherView;

nicklockwood avatar Jul 10 '14 13:07 nicklockwood

my refrencing outlet for the uiview with class FXBlurView is called Genres and my view that I want to be the underlying view is main_view. I have done:

self.Genres.underlyingView = _main_view;

I am getting the error:

Property 'underlyingView' not found on object of type 'UIView *'

maxmitch avatar Jul 10 '14 14:07 maxmitch

You've most likely declared the outlet as being of type UIView * instead of FXBlurView *. Either change the outlet declaration to FXBlurView *, or cast the call, like this:

((FXBlurView *)self.Genres).underlyingView = _main_view;

nicklockwood avatar Jul 10 '14 14:07 nicklockwood

Thank you. But this still gives a black line from where the animation starts!

maxmitch avatar Jul 10 '14 14:07 maxmitch

Maybe change the backgroundColor of _main_view to white?

nicklockwood avatar Jul 10 '14 14:07 nicklockwood

I have done

_main_view.backgroundColor = [UIColor whiteColor];

And no luck. I also tried:

_main_view.opaque = NO;

Also no luck

maxmitch avatar Jul 10 '14 14:07 maxmitch

Can you help?

maxmitch avatar Jul 17 '14 08:07 maxmitch

?

maxmitch avatar Sep 30 '14 20:09 maxmitch