UIimageView GIF animation and uiimageviewgif Animation
1. The Code is as follows (all annotations are available)
-(Void) viewDidLoad {
[Super viewDidLoad];
UIImageView * bigImageView = [[UIImageView alloc] initWithFrame: CGRectMake (100,100,100,100)];
// Create an array for storing images
NSMutableArray * imageArray = [NSMutableArray array];
For (int I = 1; I <19; I ++)
{
// Name of the spliced string image
NSString * imageString = [NSString stringWithFormat: @ "zixun _ % d", I];
// Obtain the image name based on the Image
UIImage * image = [UIImage imageNamed: imageString];
// Add an image to an array
[ImageArray addObject: image];
}
// GIF Image Group
BigImageView. animationImages = imageArray;
// Playback speed
BigImageView. animationDuration = 3;
// Playback times
BigImageView. animationRepeatCount = 1;
// Start the animation
[BigImageView startAnimating];
// Add a subview to the view
[Self. view addSubview: bigImageView];
}