2
我目前正在嘗試刷新或清除我的UIView
繪製,但很多方法無法正常工作。我想:如何清除繪圖uiview?
self.Draw.clearsContextBeforeDrawing
[self.Draw setNeedsDisplay];
self.Draw.removeFromSuperview;
我的代碼:
-(void)drawPoint:(UITouch *)touch
{
PointLocation *currentLoc = [[PointLocation alloc] init];
currentLoc.location = [touch locationInView:self];
self.previousPoint = self.point;
self.point = currentLoc;
[self drawToBuffer];
[self setNeedsDisplay];
}
有什麼辦法來清除我的uidraw?或者至少重新加載它?
其 {CGImageRef cgImage = CGBitmapContextCreateImage(offScreenBuffer); UIImage * uiImage = [[UIImage alloc] initWithCGImage:cgImage]; CGImageRelease(cgImage); [undoManager beginUndoGrouping]; [uiImage drawInRect:self.bounds];} – Freedom4ever 2012-08-07 02:45:18