首页 > 其他 > 详细

UIImageView 小幅度震动动画

时间:2015-11-12 13:20:58      阅读:321      评论:0      收藏:0      [点我收藏+]
    [UIView beginAnimations:@"shake" context:nil];
    [UIView setAnimationDuration:0.1f];
    [UIView animateWithDuration:0.1f animations:^{

        //  一次动画开始时首先向左偏转
        _imageView.transform = CGAffineTransformMakeRotation(-0.05);

    } completion:^(BOOL finished) {

        [UIView animateWithDuration:0.1f delay:0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse | UIViewAnimationOptionAllowUserInteraction animations:^{

            //  一次动画结束时向右偏转,然后一直重复进行
            _imageView.transform = CGAffineTransformMakeRotation(0.05);

        } completion:^(BOOL finished) {

            //  动画完全结束时记得归位
            _imageView.transform = CGAffineTransformMakeRotation(0);

        }];
    }];
    [UIView commitAnimations];

 

UIImageView 小幅度震动动画

原文:http://www.cnblogs.com/rgshio/p/4958366.html

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