我有一个应用程序,当前按下按钮(图像)两次。我想循环缩放按钮并摇动按钮。所以三个动画将是:缩放、平移、旋转。我怎样才能随机循环这些?这是我目前拥有的按钮:
- (IBAction)playAudioAction:(id)sender {
UIButton *btn=(UIButton *)sender;
CABasicAnimation *fullRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
fullRotation.fromValue = [NSNumber numberWithFloat:0];
fullRotation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
fullRotation.duration = 0.5;
fullRotation.repeatCount = 2;
[btn.layer addAnimation:fullRotation forKey:@"360"];
[self playAudioOfType:btn.tag];
}