UIView添加动画

// 2.抖动

    CAKeyframeAnimation *shakeAnim = [CAKeyframeAnimation animation];

    shakeAnim.keyPath = @"transform.translation.x";

    shakeAnim.duration = 0.15;

    CGFloat delta = 10;

    shakeAnim.values = @[@0, @(-delta), @(delta), @0];

    shakeAnim.repeatCount = 2;

    [self.loginView.layer addAnimation:shakeAnim forKey:nil];

posted on 2015-08-07 15:40  隐身哥  阅读(171)  评论(0编辑  收藏  举报

导航