2
我试图动画绘制对象,比如我画这种方法行:如何在Objective C中绘制线条的动画?
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(Center.x, Center.y)];
[path addLineToPoint:CGPointMake(Point.x,Point.y)];
CAShapeLayer *shapeLayer = [CAShapeLayer layer];
shapeLayer.path = [path CGPath];
shapeLayer.strokeColor = [[UIColor whiteColor] CGColor];
shapeLayer.lineWidth = 1.5;
shapeLayer.fillColor = [[UIColor clearColor] CGColor];
[self.view.layer addSublayer:shapeLayer];
一段时间,我需要动画的行有不同的Point
后,但保持Center
原样,但我不知道该怎么做。我的方法好吗?有没有更好的方法来做到这一点?
可能重复[如何动画CAShapeLayer路径和填充颜色(http://stackoverflow.com/questions/15651717/how-to-animate-cashapelayer-path-and- fillcolor) – 2014-10-01 13:15:08
这是动画绘制的路径,而不是动画后,它已经绘制(这是我想要实现的)。 虽然谢谢! :d – Shamy 2014-10-01 14:35:20