我是 ios 开发的新手。我正在实施 Taperecorder 项目,其中我有一些 CABasicAnimations 用于在录制音频和播放时旋转轮子。一切正常(录制和播放)......但是如果我按下主页,则在录制音频时按钮再次打开应用程序背景录制过程工作细轮动画不旋转..
CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
animation.fromValue = [NSNumber numberWithFloat: 2*M_PI];
animation.toValue = [NSNumber numberWithFloat:0.0f];
animation.duration = 4.0f;
animation.repeatCount = INFINITY;
[imageLeft.layer addAnimation:animation forKey:@"SpinAnimation"];
[imageRight.layer addAnimation:animation forKey:@"SpinAnimation"];