iOS animation implementation (2) ImageView Auto Animation

Source: Internet
Author: User

Uiimageview Official document (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImageView_Class/ index.html#//apple_ref/doc/uid/tp40006889) There are instructions inside

The relevant properties are as follows:

@property(nonatomic, copy) nsarray *animationimages   ; Need to animate a few frames of picture, here to store a loop of all the pictures

@property(nonatomic, copy) nsarray *highlightedanimationimages; Animated several frames of pictures, of course, is to highlight the state of the

@property(nonatomic) nstimeinterval animationduration;//The time required for a loop, in seconds, the default value is [ Animaitonimages count]/30 sec

@property(nonatomic) nsinteger animationrepeatcount;//number of cycles, default 0, infinite loop

Method:

-(void)startanimating

-(void)stopanimating

-(BOOL)isanimating

With these things, you can start making an animation. The simplest is to add a few pictures to Animationimages, then startanimation.

If you need to refine the speed and other elements, set the relevant properties directly.

On the Internet, there is a way to say this implementation animation, memory is not released. is actually putting all the frames, all loaded in memory.

The pro-test is true. In this way, it is recommended to do that small and beautiful animation can not be used to do that big picture animation, otherwise memory is too much ha. Oh.

iOS animation implementation (2) ImageView Auto Animation

Related Article

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.