Reputation: 55
I create a UIView and put it on top of an imageView,and set the uiview's background color as clearcolor,all the drawing take place on that UIView,how can just erase the line I drew on that uiview ? thanks.
Upvotes: 2
Views: 717
Reputation: 50129
call setNeedsDisplay on your view and next time drawRect dont draw the lines but just fill the whole bounds with clearColor
Upvotes: 0
Reputation: 9251
Did you try CGContextSetBlendMode(context, kCGBlendModeClear)
and then draw the area you want to erase. Clearing the context with CGContextClearRect
can be used too if you want to clear the whole screen (or a rectangular part of it).
Upvotes: 2