我想知道一次性在一系列路径中制作动画的最佳方法是什么。我只能以某种方式处理它。
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView animateWithDuration:5
delay:7
options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse
animations:^{faceAni.transform = CGAffineTransformMakeTranslation(40, 80); }
completion:^(BOOL fin) {
if (fin) {
faceAni.transform = CGAffineTransformMakeTranslation(80, 40);
}
}
];
建议?
答案 0 :(得分:0)
使用此代码可能会对您有所帮助:
{
context = UIGraphicsGetCurrentContext();
[[transperantview layer] renderInContext:context];
CGContextMoveToPoint(context, x1, y1);
CGContextSetRGBStrokeColor(context, (255/255.0), (0/255.0), (0/255.0), 1.0);
CGContextSetLineWidth(context, 5);
CGContextAddLineToPoint(context, x2, y2);
CGContextDrawPath(context, kCGPathStroke);
imageView.contentMode = UIViewContentModeScaleToFill;
UIGraphicsEndImageContext();
}