iOS 抖动动画

// 抖动动画
CABasicAnimation *shakeAnimation = [CABasicAnimation animationWithKeyPath:@”transform.translation.y”];
shakeAnimation.duration = 0.25f;
shakeAnimation.fromValue = [NSNumber numberWithFloat:-5];
shakeAnimation.toValue = [NSNumber numberWithFloat:5];
shakeAnimation.autoreverses = YES;
[_cLable.layer addAnimation:shakeAnimation forKey:nil];
// 放大动画
// [UIView animateWithDuration:0.25f animations:^{
// for (int i = 23; i > 20; i–) {
// _countLable.frame = CGRectMake(floatLable, 0, 23, 23);
// _countLable.layer.cornerRadius = i / 2;
// _countLable.font = FontSet(15);
// }
// } completion:^(BOOL finished) {
// _countLable.frame = CGRectMake(floatLable, 0, 20, 20);
// _countLable.font = FontSet(12);
// }];

你可能感兴趣的:(iOS)