如何在调用第二个动画后使一个动画持续不断呢?例如:
1)开始让一个对象脉动
2)在它脉动时移动它
3)它继续脉动
所有的东西都可以工作,除了第二个动画无限期地停止第一个动画。以下是一些示例代码:
1)开始让一个对象脉动
2)在它脉动时移动它
3)它继续脉动
所有的东西都可以工作,除了第二个动画无限期地停止第一个动画。以下是一些示例代码:
//Pulsate **
[UIView animateWithDuration:0.25
delay:0
options: (UIViewAnimationCurveEaseOut | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionRepeat)
animations:^{
CGAffineTransform currentTransform = self.transform;
CGAffineTransform newTransform1 = CGAffineTransformScale(currentTransform, .95, .95);
[self setTransform:newTransform1];
CGAffineTransform newTransform2 = CGAffineTransformScale(currentTransform, 1, 1);
[self setTransform:newTransform2];
}
completion:nil];
//Move **
[UIView animateWithDuration:0.30
delay:0
options: (UIViewAnimationCurveEaseOut | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState )
animations:^{
[[(UIPinchGestureRecognizer*)sender view] setCenter:CGPointMake(myAppDelegate.MCViewReference.center.x-300, myAppDelegate.MCViewReference.center.y)];
}
completion:^(BOOL finished){
}];