How do I disable clipping in a CALayer? I am overriding drawInContext, but I want to be able to draw lines that extend outside the bounds of the CALayer and I do not want to do a separate drawing pass on the parent layer to make this happen.
You can't draw using Quartz outside of the bounds of a CALayer or UIView. As Noah suggests, you'll need to expand the bounds of the layer by a set amount in order to draw this.
You can still do this without having to do some drawing in the parent layer, as long as your parent layer's masksToBounds
property is set to NO. That way, even if your sublayer extends out past the edge of the parent, it will still be drawn properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With