iOS Development Animation (Animation) Summary

Source: Internet
Author: User

UIView, flip, rotate, offset, flip, zoom, invert animation effects[OBJC]View PlainCopy 
  1. Start animation
  2. [UIView beginanimations:@ "Doflip" context: nil];
  3. //settings are often
  4. [UIView setanimationduration:1];
  5. //Set animation fade
  6. [UIView setanimationcurve:uiviewanimationcurveeaseinout];
  7. //Set up proxy
  8. [UIView setanimationdelegate: Self];
  9. //Set Flip direction
  10. [UIView setanimationtransition:
  11. Uiviewanimationtransitionflipfromleft forview:manimageview cache:YES];
  12. //End of animation
  13. [UIView commitanimations];

Rotate animation[OBJC]View PlainCopy 
  1. Create a Cgaffinetransform Transform object
  2. Cgaffinetransform transform;
  3. Set Rotation degree
  4. Transform = Cgaffinetransformrotate (Manimageview. transform,m_pi/6. 0);
  5. Animation start
  6. [UIView beginanimations:@ "Rotate" context: nil];
  7. Animations are often
  8. [UIView setanimationduration:2];
  9. Add Agent
  10. [UIView setanimationdelegate: Self];
  11. Gets the value of the transform
  12. [Manimageview Settransform:transform];
  13. Turn off animations
  14. [UIView commitanimations];


Offset animation

[UIView beginanimations:@ "move" context:nil];

[UIView Setanimationduration:2];

[UIView setanimationdelegate:self];

Change the value of x, y of its frame

Manimageview.frame=cgrectmake (100,100, 120,100);

[UIView commitanimations];

Page flipping animation

[OBJC]View PlainCopy 
  1. [UIView beginanimations:@ "Curlup" context: nil];
  2. [UIView setanimationcurve:uiviewanimationcurveeaseinout]; //Specifies the animation curve type, which is the default, linear is constant speed
  3. //Set animations often
  4. [UIView setanimationduration:1];
  5. [UIView setanimationdelegate: Self];
  6. //Set the direction of page flipping
  7. [UIView setanimationtransition:uiviewanimationtransitioncurlup forview:manimageview cache:YES];
  8. //Close animation
  9. [UIView commitanimations];

Zoom Animation

[OBJC]View PlainCopy 
  1. Cgaffinetransform transform;
  2. Transform = Cgaffinetransformscale (Manimageview. Transform,1. 2,1. 2);
  3. [UIView beginanimations:@ "scale" context: nil];
  4. [UIView setanimationduration:2];
  5. [UIView setanimationdelegate: Self];
  6. [Manimageview Settransform:transform];
  7. [UIView commitanimations];


The inverse animation effect is to take his opposite animation according to the current animation

[OBJC]View PlainCopy 
  1. Cgaffinetransform transform;
  2. Transform=cgaffinetransforminvert (Manimageview. Transform);
  3. [UIView beginanimations:@ "Invert" context: nil];
  4. [UIView setanimationduration:2]; Animations are often
  5. [UIView setanimationdelegate: Self];
  6. [Manimageview Settransform:transform]; //Get the transform of the changed view
  7. [UIView commitanimations]; //Close animation

iOS Development Animation (Animation) Summary

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.