TOM猫2

作者: 墨染倾 | 来源:发表于2016-07-12 23:24 被阅读0次

    精简算法

    -(void)tomCatAnimationWithName:(NSString *)name       //定义了两个方法

    withCount:(NSInteger)count

    {  if([self.tomCatView isAimating]{     判断动画是否正在运行

    return;

    }

    NSMutableArray *images = [NSMutableArray array];//  设置数组

    for(NSInteger i = 0;i<count;i++){

    NSString *imagename=[UIImage imageNamed=imageame]; //根据count加载图片,添加到数组里

    [images addObjct;image];

    }

    self.tomCatView.animatingImages = images;   //设置动画图片数组

    self.tomCaatView.animationDuration=count * 0.075;

    self.tomCatView.animationRepeatCount = 1;

    [self.tomCatView startAnimating];

    }

    相关文章

      网友评论

          本文标题:TOM猫2

          本文链接:https://www.haomeiwen.com/subject/zzjsjttx.html