首页 > 其他 > 详细

视图左右抖动动画

时间:2015-04-07 17:06:24      阅读:270      评论:0      收藏:0      [点我收藏+]

CABasicAnimation *shake = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];

    shake.fromValue = [NSNumber numberWithFloat:-5];

    shake.toValue = [NSNumber numberWithFloat:5];

    //执行时间

    shake.duration = 0.1;

    //是否重复

    shake.autoreverses = YES;

    //次数

    shake.repeatCount = 2;

    [self.label.layer addAnimation:shake forKey:@"shakeAnimation"];

    self.label.alpha = 1.0;

    [UIView animateWithDuration:2.0 delay:0.0 options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction animations:^{

        //self.label.alpha = 0.0; //透明度变0则消失

 

    } completion:nil];

视图左右抖动动画

原文:http://www.cnblogs.com/somnus-l/p/4398541.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!