首页 > 其他 > 详细

设置图片不停旋转会卡顿

时间:2016-01-09 20:09:04      阅读:144      评论:0      收藏:0      [点我收藏+]

解决方法为

把函数名里所传需要的参数放到全局变量 即可

- (void)rotateWithSpeed:(CGFloat)spd

{

[UIView animateWithDuration:spd

                          delay:0

                        options:UIViewAnimationOptionCurveLinear

                     animations:^{

                         self.blade.transform = CGAffineTransformRotate(self.blade.transform, M_PI_2);

                     }

                     completion:^(BOOL finished){

                         if (finished) {

                             [self rotateWithSpeed:spd];

                         }

                     }];

}

 

换为

 

- (void)rotateWithSpeed

{

[UIView animateWithDuration:self.spd

                          delay:0

                        options:UIViewAnimationOptionCurveLinear

                     animations:^{

                         self.blade.transform = CGAffineTransformRotate(self.blade.transform, M_PI_2);

                     }

                     completion:^(BOOL finished){

                         if (finished) {

                             [self rotateWithSpeed];

                         }

                     }];

}

 

 

 

设置图片不停旋转会卡顿

原文:http://www.cnblogs.com/aoxer/p/5117009.html

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