iOS Development learning Note 022-imageview implementation animations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.