【发布时间】:2013-02-25 20:54:06
【问题描述】:
我希望在用户单击屏幕上的任意位置时绘制一个圆圈。这段代码缺少什么/有什么问题?
- (void)drawRect:(CGRect)rect
{
if (UITouchPhaseBegan)
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(context, 0, 0, 225, 1);
CGContextSetRGBFillColor(context, 0, 0, 255, 1);
CGRect rectangle = CGRectMake(50, 50, 500, 500);
CGContextStrokeEllipseInRect(context, rectangle);
}
}
【问题讨论】:
标签: objective-c cocoa-touch quartz-graphics