利用UIImageView加载一序列的图像,可以实现动态图像的效果。
感谢开发者@龙龙酱丶 提供代码片段
NSMutableArray * images = [NSMutableArray arrayWithCapacity:6]; for (int i = 1; i <= 6; i++) { NSString * imageName = [NSString stringWithFormat:@"run%d.tiff",i]; UIImage * image = [UIImage imageNamed:imageName]; [images addObject:image]; } imageview.animationImages = images; imageview.animationDuration = 0.3; [imageview startAnimating];