如何在iPhone SDK中制作雷达动画?

如何在iPhone SDK中制作雷达动画?,iphone,animation,core-animation,Iphone,Animation,Core Animation,有人知道如何制作下图所示的雷达动画吗? 随着它向外生长?我必须使用Quartz或其他方法绘制圆?要在UIView子类中绘制静态圆: - (void)drawRect:(CGRect)rect { CGRect rect = { 0.0f, 0.0f, 100.0f, 100.0f }; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, 1.0

有人知道如何制作下图所示的雷达动画吗?


随着它向外生长?我必须使用Quartz或其他方法绘制圆?

要在
UIView
子类中绘制静态圆:

- (void)drawRect:(CGRect)rect
{
    CGRect rect = { 0.0f, 0.0f, 100.0f, 100.0f };
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 1.0);
    CGContextSetLineWidth(context, 2.0f);
    CGContextAddEllipseInRect(context, rect);
    CGContextStrokePath(context);
}
从那里你只需要用一个定时器设置它的动画,改变矩形的大小,并添加更多的圆