小智 4
您可以使用图像序列,这里是代码:
for(NSInteger i=1;i<=totalImages;i++){
NSString *strImage = [NSString stringWithFormat:@"Activity_%d",i];
UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:strImage ofType:@"png"]];
[imageArray addObject:image];
}
splashImageView.animationImages = imageArray;
splashImageView.animationDuration = 0.8;
Run Code Online (Sandbox Code Playgroud)
只需调用 UIImageView 的 startAnimation 和 endAnimation 方法即可。
| 归档时间: |
|
| 查看次数: |
21279 次 |
| 最近记录: |