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];//停止动画
    }

    效果如下:

    仅做记录!

  • 相关阅读:
    2020软件工程作业00
    2020软件工程作业03
    2020软件工程作业02
    软件工程作业01
    2020软件工程作业06
    2020软件工程作业05
    问题清单
    2020软件工程作业04
    2020软件工程作业02
    2020软件工程作业1
  • 原文地址:https://www.cnblogs.com/hero11223/p/10329824.html
Copyright © 2011-2022 走看看