UIView左右晃动特效
作者:
iOS乐乐 | 来源:发表于
2019-08-29 17:35 被阅读0次-(void)showErrorAnimationIsPassoword:(BOOL)isPassword
{
CAKeyframeAnimation *shakeAnim = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"];
shakeAnim.values = @[@-10, @0, @10, @0];
shakeAnim.repeatCount = 3;
shakeAnim.duration = 0.1;
if (isPassword)
{
[self.loginView.passwordView.layer addAnimation:shakeAnim forKey:nil];
}
else
{
[self.loginView.phoneView.layer addAnimation:shakeAnim forKey:nil];
}
}
本文标题:UIView左右晃动特效
本文链接:https://www.haomeiwen.com/subject/wdcwectx.html
网友评论