码迷,mamicode.com
首页 > 移动开发 > 详细

ios开发--animation flash动画

时间:2016-03-31 09:33:52      阅读:304      评论:0      收藏:0      [点我收藏+]

标签:

 
技术分享
 
/**
 *  showAnimationFlash
 */
+ (void)showAnimationFlashWithView:(UIView *)animationView duration:(CGFloat)duration {
    CAKeyframeAnimation *popAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
    if (!duration) {
        popAnimation.duration = .8;
    }
    popAnimation.duration = duration;
    popAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.0f, 0.01f, 1.0f)],[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.1f, 1.1, 1.0f)],[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.9f, 0.9, 1.0f)],[NSValue valueWithCATransform3D:CATransform3DIdentity]];
    popAnimation.keyTimes = @[@0.2f,@0.5f,@0.75f,@1.0f];
    popAnimation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut],[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [animationView.layer addAnimation:popAnimation forKey:nil];
}

ios开发--animation flash动画

标签:

原文地址:http://www.cnblogs.com/wanghuaijun/p/5339875.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!