2010-08-27 48 views
1

我一直在使用下面的代碼來繪製上的UIView目標C - 消除繪製

CGContextRef context = UIGraphicsGetCurrentContext(); 
CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); 
CGContextSetRGBFillColor(context, 0.0, 0.0, 1.0, 1.0); 
CGContextSetAlpha(context, 0.5); 
CGContextSetLineWidth(context, 10.0); 
CGContextMoveToPoint(context, point.x, point.y); 
CGContextAddLineToPoint(context, point.x, point.y); 
CGContextStrokePath(context); 

所以這部分作品。
現在我該如何清除繪圖?大部分示例僅顯示繪圖。遇到難以找到關鍵字的谷歌。

感謝,
三通

回答

0
[self setNeedsDisplay]; 

它將消息drawRect:發送到視圖。