作者:杨建谦461128 | 来源:互联网 | 2023-05-16 15:45
创建UIImageView,添加到界面UIImageView*imageView[[UIImageViewalloc]initWithFrame:CGRectMake(20,20,
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, 100, 100)];
[self.view addSubview:imageView];
NSMutableArray *imgArray = [NSMutableArray array];
for (int i=1; i<7; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"clock%02d.png",i]];
[imgArray addObject:image];
}
imageView.animatiOnImages= imgArray;
imageView.animatiOnDuration= 6*0.15;
imageView.animatiOnRepeatCount= 0;
[imageView startAnimating];