因此,我有一张图像,用于向用户显示在他们点击按钮后正在执行同步,但无法弄清楚如何让它保持旋转几秒钟而不是一次....以下是我用来执行动画的方法。有人可以帮我弄清楚如何让它旋转几秒钟吗?
提前致谢!
- (void)syncTapped:(UIButton *)standardButton {
[self animateSynchronization];
repeatSyncAnimation = YES;
}
-(void)animateSynchronization {
repeatSyncAnimation = YES;
[UIView animateWithDuration:0.23 delay:0.0 options:UIViewAnimationOptionCurveLinear animations:^{
syncImage.transform = CGAffineTransformRotate(syncImage.transform, M_PI_2);
} completion:^(BOOL finished){
if (repeatSyncAnimation) {
[self animateSynchronization];
[self stopSynchronizationAnimation];
}
}];
}