The animation to be played here is a lot of continuous animation, the continuous play will show the animation effect.
The approximate process is:
Create a new single view application, and then add an Image view control to the view. Adds a property to the Image view control.
The main code is
1 //Play Animation Methods2- (void) Playanim: (int) Count Name: (NSString *) name3 {4 //1 Creating a mutable array5Nsmutablearray *images =[Nsmutablearray array];6 //2 Add a picture7 for(inti =0; I < count; I + +)8 {9 //two digits are not enough for 0 .TenNSString *imagename = [NSString stringWithFormat:@"%@_%02d.jpg", name,i]; One //NSLog (@ "%@", name); AUIImage *img =[UIImage imagenamed:imagename]; - [Images addobject:img]; - } the //3 Set Display picture, in order -_tom.animationimages =images; - //4 Play only once -_tom.animationrepeatcount =1; + //5 Set the animation playback time, set the animation duration according to the number of pictures -_tom.animationduration =0.1*count; + //6 Start Animation A [_tom startanimating]; at}
iOS Development learning Note 022-imageview implementation animations