问题
The API Docs for CALayer state: (I'm not sure if the docs are up to date??)
compositingFilter A CoreImage filter used to composite the receiver’s contents with the background. Animatable.
@property(retain) id compositingFilter
...
Special Considerations While the CALayer class exposes this property, Core Image is not available in iOS. Currently the filters available for this property are undefined.
But CoreImage IS available on iOS5, so could I add a CoreImage filter to a CALayer and add that layer to another layer and expect it to work?
I want to add a sublayer to a layer and have it use a specific blend mode (multiply). I can't figure out how to do this otherwise.
回答1:
Although the docs have not been revised, and although Core Image is now partially available in iOS, only a tiny bit of its functionality is present. CALayer compositing filter, background filters, and so forth, are among the things that are not present. So you should go on ignoring the compositingFilter
property.
来源:https://stackoverflow.com/questions/8378074/calayer-compositingfilter-ios-5-and-coreimage