zoukankan      html  css  js  c++  java
  • iOS开发之--UIImageView的animationImages动画

    图片动画实现,代码如下:

    -(UIImageView *)animationImageView
    {
        if (!_animationImageView) {
            _animationImageView= [[UIImageView alloc]initWithFrame:CGRectMake(self.view.frame.size.width/2-180/2, self.view.frame.size.height/2-180/2, 180, 180)];
            [self.view addSubview:_animationImageView];
        }
        return _animationImageView;
    }
    
    -(void)buildAnimationImageView
    {
        NSArray *ary = @[[UIImage imageNamed:@"image1"],
                         [UIImage imageNamed:@"image2"],
                         [UIImage imageNamed:@"image3"],
                         [UIImage imageNamed:@"image4"]
                         ];
        self.animationImageView.animationImages = ary;
        self.animationImageView.animationDuration = 5;//动画时间
        self.animationImageView.animationRepeatCount = 0;//动画重复次数,0:无限
        [self.animationImageView startAnimating];//开始动画
    //    [self.animationImageView stopAnimating];//停止动画
    }

    效果如下:

    仅做记录!

  • 相关阅读:
    HTML标签(二)
    HTML 表单
    HTML列表
    HTML表格
    Critical Section Problems
    Stack, Queue and Priority Queue
    Introduction to Dynamic Set
    Introduction to Divide-and-Conquer
    Sorting Algorithms Overview
    Python学习笔记(三)数据类型
  • 原文地址:https://www.cnblogs.com/hero11223/p/10329824.html
Copyright © 2011-2022 走看看