废话少说,直接上代码:
var barsAnim = UIImageView(frame: self.view.frame);
barsAnim.animationImages =
NSArray() as [AnyObject];
barsAnim.animationImages?.append(UIImage(named:
"wave_000")!);
barsAnim.animationImages?.append(UIImage(named:
"wave_001")!);
barsAnim.animationImages?.append(UIImage(named:
"wave_002")!);
barsAnim.animationImages?.append(UIImage(named:
"wave_003")!);
barsAnim.animationImages?.append(UIImage(named:
"wave_004")!);
barsAnim.animationImages?.append(UIImage(named:
"wave_005")!);
barsAnim.animationDuration = 2;
barsAnim.animationRepeatCount =
0;
barsAnim.startAnimating();
self.view.addSubview(barsAnim);
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-13 11:35:27