Obaid
Obaid

Reputation: 197

CALayer BlendMode

I am creating a simple iOS application in which I have two CALayers, I want to add the blend effect on the upper CALayer to display the content on the second layer. I dont want to do it alpha. Is there any way to do this without changing the alpha?

Upvotes: 3

Views: 2370

Answers (3)

hezhk3
hezhk3

Reputation: 31

There's a tricky way to achieve this.

compositingFilter works but filter names should be like subtractBlendMode (lower camel case), not CISubtractBlendMode.

Here is a demo:

https://github.com/arthurschiller/CompositingFilters

Upvotes: 2

Bhupendra
Bhupendra

Reputation: 2545

Use property

opacity

of CALayer as there is nothing such as alpha. Its opacity instead of alpha so try setting opacity of the layers.

Upvotes: 0

rob mayoff
rob mayoff

Reputation: 386058

iOS (as of 5.1) does not currently support any blend effects on CALayer. In my testing, the compositingFilter property is ignored.

Upvotes: 6

Related Questions