美文网首页
UIImageView实现动画

UIImageView实现动画

作者: 逆战逆的态度 | 来源:发表于2016-06-28 11:00 被阅读29次
    UIImageView  * Animation = [UIImageView alloc] initWithFame:[UIScreen mainScreen] bounds]];
    [self.view  addSubview:Animation];
    //设置动画帧
    Animation.animationImages=[NSArray arrayWithObjects:
    [UIImage imageNamed:@"1.jpg"],
    [UIImage imageNamed:@"2.jpg"],
    [UIImage imageNamed:@"3.jpg"],
    [UIImage imageNamed:@"4.jpg"],
    [UIImage imageNamed:@"5.jpg"],nil ];
    //设置动画总时间
    Animation.animationDuration=1.0;
    //设置重复次数,0表示不重复
    Animation.animationRepeatCount=0;
    //开始动画
    [Animation startAnimating];    
    

    使用延时来完成动画结束时的回调

      [self performSelector:@selector(doOtherAction) withObject:nil afterDelay:ANIMATION_TIME];
    

    相关文章

      网友评论

          本文标题:UIImageView实现动画

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