美文网首页
Swift 图片动画

Swift 图片动画

作者: 吉林天师 | 来源:发表于2019-08-28 20:28 被阅读0次
        let animateGifView:UIImageView  = UIImageView.init()
        animateGifView.frame = CGRect.init(x: 100, y: 100, width: 100, height: 100)
        let image = UIImage(named: "1")
        var gifArray:[UIImage] = []
        for i in 1...6{
            gifArray.append(UIImage(named: String(format:"%d",i))!)
        }
        //                for idx in 0...3 {
        //                    print("idx =\(idx)");
        //                }
        animateGifView.animationImages = gifArray
        animateGifView.animationDuration = 1
        animateGifView.animationRepeatCount = 100
        animateGifView.startAnimating()
        //        animateGifView.autorelease = true
        view.addSubview(animateGifView)

相关文章

网友评论

      本文标题:Swift 图片动画

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