Reputation: 2563
I'm trying to draw a complex border around a UIView in it's drawRect method using core graphics. The border is being clipped because it's outside of the view's bounds. Is there any way to prevent this clipping? Setting clipsToBounds to NO doesn't work.
Upvotes: 2
Views: 2510
Reputation: 4168
drawRect:
gives you a CGRect
. This defines the area in which you can draw. As it stands, you cannot draw outside this area.
You'd have to look into a different solution to your problem. I'd suggest CALayer
s, or a subview/superview hierarchy, perhaps a border view and a content view. But don't try doing that in drawRect:
, unless you can get the desired results while keeping within the area specified by drawRect:
.
Upvotes: 3