I have a collection of CALayers . Each layer is a sublayer of the same CALayer parent, and each of them has a shadow applied to it. Layers are located dynamically, and there are many of them, so I can not predict how they will be organized ahead of time.
If the layers are adjacent to each other (close enough to almost touch), the shadow of one of the CALayers displayed on top of the other CALayer . This is probably the desired effect in most cases, but I want my layers to exist in the same z-plane. (An example of this is the way CSS3 shadows are used for block elements in web design.)
Is it possible? How can I achieve this?
(I had this idea: adding a βshadowβ sublevel to each CALayer with my own shadow image and setting the z-position to a lower value. But doesnβt the layer tree make this impossible? -Position in a single-level coordinate system does not depend on z-positions in another layer coordinate system, right?)
source share