Three modes and basic code implementations for picture animations in iOS

Source: Internet
Author: User

-(void) play

{

First picture animation mode Kinsoku

Tail Way

[UIView beginanimations:nil context:nil];//Animation starts

[UIView setanimationduration:10];//setting animation playback duration

/* Internal write image processing */

[UIView commitanimations];//Commit Animation

Second way: Picture animation end Processing mode

[UIView animatewithduration:10 animations:^{

/* Picture processing operation */

} completion:^ (BOOL finished) {

if (finished)

{

/* Action to end playback of the animation, you can set the control's light-in fade effect */

}

}];

The third way; sequence frame mode

Uiimageview *image=[[uiimageview Alloc]init];

image.animationduration=3;//Setting Animation duration

[Image Setanimationimages:[nsarray new]];//set up a picture resource to play, like to put a movie

image.animationrepeatcount=1;//setting the number of plays

[Image startanimating];//Start animation

[Image isanimating];//to determine if the animation is complete

[Image stopanimating];//End animation

}

Three modes and basic code implementations for picture animations in iOS

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.