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) …
继续阅读 →