开发者

How to clear and then redraw a quartz drawing

I'm making a complex drawing using quartz based on passed in information. The only part I haven't been able to figure out is how do I clear the lines, rectangles, etc th开发者_运维问答at I've already drawn? Basically, I want to erase the whole drawing and just draw it again from the new data.


If you set your UIView's clearContextBeforeDrawing property to YES, then the system should take care of filling its area with its backgroundColor before calling its drawRect: method.


If you want to clear something that's not tracked as part of the current state, it's probably less expensive to just release your old context and start a new one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜