Blur CALayer Superlayer

I have a CALayer and a sublevel. What I want to achieve is blurring the super layer (the area under the sublevel), as standard sheets do. I tried setting .compositingFilter to a sublevel, but this does not work.

Any ideas how to solve this?

Code from init sublayers:

CIFilter *blur = [CIFilter filterWithName:@"CIGaussianBlur"]; [blur setDefaults]; self.layer.backgroundFilters = [NSArray arrayWithObject:blur]; 
+2
source share
1 answer

The above should work fine, depending on the context in which it is used. with a simple superlayer containing an image, the following works for me:

 CALayer *blurLayer = [CALayer layer]; CIFilter *blur = [CIFilter filterWithName:@"CIGaussianBlur"]; [blur setDefaults]; blurLayer.backgroundFilters = [NSArray arrayWithObject:blur]; [superLayer addSublayer:blurLayer]; 
+3
source

All Articles