输入错误时的输入框抖动效果
CAKeyframeAnimation *shake=[CAKeyframeAnimation animationWithKeyPath:@"position.x"];
shake.values=@[@0,@-10,@10,@-10,@0];
shake.additive=YES;
shake.duration=0.25;
[view.layer addAnimation:shake forKey:@"shake"];
输入错误时的输入框抖动效果
CAKeyframeAnimation *shake=[CAKeyframeAnimation animationWithKeyPath:@"position.x"];
shake.values=@[@0,@-10,@10,@-10,@0];
shake.additive=YES;
shake.duration=0.25;
[view.layer addAnimation:shake forKey:@"shake"];