So, I'm doing some custom drawing in a UIControl
subclass开发者_如何学Go by overriding the drawRect:
method. The issue is that the control is clipping a glow that I drew in it even though I've set the clipsToBounds
property to NO
.
Any ideas?
EmeilioPelaez has it right. You can't draw outside your own frame. If you want the glow to overlap other UI elements, make the frame big enough to draw the glow, then make sure to set your own opaque
flag to NO, and set the backgroundColor to [UIColor clearColor]
. Keep in mind, compositing views incurs a pretty big performance hit, so maybe ask yourself if drawing that glow on top of other elements is really necessary.
精彩评论