开发者

How to avoid background erasing when drawing lines?

I'm writing a paint app.

When drawing a line in CGContext, the background with the size of the bounding box of the line is alwa开发者_如何学运维ys got erased - the underlying lines in that box will be cleared.

How to avoid the background erasing?


[EDIT] Better: see How to draw a line on top of an image when finger moves on iPhone. If your image is added as a background specifically, not directly to the view, it will do what you're looking for.

[original] Keep everything you've drawn already, and redraw it in every call to drawRect via setNeedsDisplay.

Or, set your UIView containing the line to UIColor clearColor.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜