【发布时间】:2012-06-22 16:38:27
【问题描述】:
我正在使用
penLayer 是一个 UIView
UIGraphicsBeginImageContext(penLayer.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
//My Drawing Code
penLayer.image = UIGraphicsGetImageFromCurrentImageContext();
[penLayer setNeedsDisplay];
这画得很好,但每次我调用 drawRect 它都会抹去以前的东西 目前我必须将所有绘图数据保存到字典中
有没有办法阻止它在每次调用 drawRect 时清除,并且可能有一个 UIButton 在需要时调用 clear ?
谢谢
【问题讨论】:
标签: iphone ios5 core-graphics quartz-graphics