点击图片旋转动画和放大动画

在工程中比较常写的2种
点击按钮图片旋转来表示刷新

 -(void)animateRotation
{
    dispatch_async(dispatch_get_main_queue(), ^{
        CABasicAnimation *layer = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
        layer.toValue = @(2*M_PI);
        layer.duration = 1;
        layer.removedOnCompletion = false;
        layer.repeatCount = MAXFLOAT;
        [self.refreshImageView.layer addAnimation:layer forKey:@"xuanzhuangXX"];
    });
}
-(void)removeAnimate
{
    [self.refreshImageView.layer removeAllAnimations];
}

放大动画

 CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
    animation.repeatCount = 1;
    animation.duration = 0.2;
    animation.fillMode = kCAFillModeForwards;
    animation.removedOnCompletion = YES;
    animation.values = @[@(1), @(1.5), @(1)];
    [view.layer addAnimation:animation forKey:@"beginaniamtion"];
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容