customizing simple animations

Source: Internet
Author: User

Comments:

Duration Animation finish time,
Delay animation extended time, can be understood as animation speed of time control

One, using

Cgaffinetransformmakescale to do the zoom effect of the graph

View.transform = Cgaffinetransformmakescale (1,1); [UIView animatekeyframeswithduration:duration/3Delay:delay options:0animations:^{        //EndView.transform = Cgaffinetransformmakescale (1.2,1.2); } Completion:^(BOOL finished) {[UIView animatekeyframeswithduration:duration/3Delay0Options0animations:^{            //EndView.transform = Cgaffinetransformmakescale (0.9,0.9); } Completion:^(BOOL finished) {[UIView animatekeyframeswithduration:duration/3Delay0Options0animations:^{                //EndView.transform = Cgaffinetransformmakescale (1,1); } Completion:^(BOOL finished) {}];    }]; }];

Two, combine alpha to do flash zoom

1 ;     = Cgaffinetransformmakescale (0.90.9);        [UIView animatekeyframeswithduration:duration/3 delay:delay options:0 animations:^{         // End        0 ;         = Cgaffinetransformmakescale (1.21.2);    } completion:^(BOOL finished) {            }];

Third, using

Cgaffinetransformmaketranslation to do the mobile animation of the view

View.transform = Cgaffinetransformmaketranslation (Cgrectgetwidth ([UIScreen mainscreen].bounds),0); [UIView animatekeyframeswithduration:duration/4Delay:delay options:0animations:^{        //EndView.transform = Cgaffinetransformmaketranslation (-Ten,0); } Completion:^(BOOL finished) {[UIView animatekeyframeswithduration:duration/4Delay0Options0animations:^{            //EndView.transform = Cgaffinetransformmaketranslation (5,0); } Completion:^(BOOL finished) {[UIView animatekeyframeswithduration:duration/4Delay0Options0animations:^{                //EndView.transform = Cgaffinetransformmaketranslation (-2,0); } Completion:^(BOOL finished) {[UIView animatekeyframeswithduration:duration/4Delay0Options0animations:^{                    //EndView.transform = Cgaffinetransformmaketranslation (0,0); } Completion:^(BOOL finished) {}];        }];    }]; }];

Of course, these are all can be combined to do a more cool animation, only need to understand the principle of response, you can do the definition of animation as needed

customizing simple 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.