发表于 2015-12-22 09:47:30 by 月小升
func donghua(){
let av = UIImageView()
let img = UIImage(named:"3.png") //使用两个图片循环重复展示,形成动画效果
let img2 = UIImage(named:"4.png")
// av.image = img
var imgs=[UIImage]()
imgs.append(img!)
imgs.append(img2!)
av.frame=CGRectMake(100,100,200, 200)
av.center=self.view.center
av.animationImages = imgs
av.animationDuration=2
// av.backgroundColor=UIColor.whiteColor()
//av.color=UIColor.redColor()
av.startAnimating()
self.view.addSubview(av)
}
This entry was posted in
Xcode and tagged
swift,
动画. Bookmark the
permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:
月小升博客 –
https://java-er.com/blog/swift-image-run/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力.