Animation CAShapeLayer

Ich ein Diagramm zeichnen mit diesem code:

CAShapeLayer *curentGraph = [CAShapeLayer new];
CGMutablePathRef linePath = CGPathCreateMutable();
curentGraph.lineWidth = 3.0f;
curentGraph.fillColor = [[UIColor clearColor] CGColor];
curentGraph.strokeColor = [colorGraph CGColor];
for (NSValue *value in arrOfPoints) {
    CGPoint pt = [value CGPointValue];
    CGPathAddLineToPoint(linePath, NULL, pt.x,pt.y);
};
curentGraph.path = linePath;CGPathRelease(linePath);
[self.layer addSublayer:curentGraph];

und es sieht so aus

Animation CAShapeLayer

Aber ich habe ein problem. Ich brauche so animieren Sie die Grafik wie es scheint. Jeder Punkt sollte von position y = 0 zu y = pt.y. Tun, wie Sie in die Grafik auf dieser Seite.

Wie kann ich animiere meine Grafik so?

InformationsquelleAutor Max Sim | 2014-02-14
Schreibe einen Kommentar