nicklockwood / FXBlurView

[DEPRECATED]
Other
4.94k stars 713 forks source link

Blurview coming as a black color in ios7 #67

Open sourcebits-mahesh opened 10 years ago

sourcebits-mahesh commented 10 years ago

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

nicklockwood commented 10 years ago

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.

maxmitch commented 10 years ago

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?

nicklockwood commented 10 years ago

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.

maxmitch commented 10 years ago

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

nicklockwood commented 10 years ago

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;
maxmitch commented 10 years ago

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 *'

nicklockwood commented 10 years ago

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;
maxmitch commented 10 years ago

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

nicklockwood commented 10 years ago

Maybe change the backgroundColor of _main_view to white?

maxmitch commented 10 years ago

I have done

_main_view.backgroundColor = [UIColor whiteColor];

And no luck. I also tried:

_main_view.opaque = NO;

Also no luck

maxmitch commented 10 years ago

Can you help?

maxmitch commented 9 years ago

?