您的位置:首页 > 移动开发 > IOS开发

iOS 抖动动画

2016-01-23 15:14 483 查看
// 抖动动画

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-抖动动画