UIView animation effect ---- flip. Rotate. offset. Flip. Zoom. Reverse animation effect, uiview ----

Source: Internet
Author: User

UIView animation effect ---- flip. Rotate. offset. Flip. Zoom. Reverse animation effect, uiview ----

  • Flip Animation
// Start the animation [UIView beginAnimations: @ "doflip" context: nil]; // set [UIView setAnimationDuration: 1] from time to time; // set the animation to fade in and out [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut]; // sets the proxy [UIView setAnimationDelegate: self]; // sets the flip Direction [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView: manImageView cache: YES] // animation end [UIView commitAnimations];
  • Rotating Animation
// Create a CGAffineTransform transform object CGAffineTransform transform; // set the rotation level transform = CGAffineTransformRotate (manImageView. transform, M_PI/6.0); // The animation starts [UIView beginAnimations: @ "rotate" context: nil]; // The animation often [UIView setAnimationDuration: 2]; // Add the proxy [UIView setAnimationDelegate: self]; // obtain the transform value [manImageView setTransform: transform]; // disable the animation [UIView commitAnimations];
  • Offset Animation
[UIView beginAnimations: @ "move" context: nil]; [UIView setAnimationDuration: 2]; [UIView setAnimationDelegate: self]; // change the x of its frame, value of y manImageView. frame = CGRectMake (100,100,120,100); [UIView commitAnimations];
  • Flip Animation
[UIView beginAnimations: @ "curlUp" context: nil]; [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut]; // specifies the animation curve type, which is the default enumeration, for linear animation with a uniform speed // [UIView setAnimationDuration: 1]; [UIView setAnimationDelegate: self]; // set the page turning direction [UIView setAnimationTransition: Direction forView: manImageView cache: YES]; // disable the animation [UIView commitAnimations];
  • Zoom Animation
CGAffineTransform transform; transform = CGAffineTransformScale(manImageView.transform,1.2,1.2); [UIView beginAnimations:@"scale" context:nil]; [UIView setAnimationDuration:2]; [UIView setAnimationDelegate:self]; [manImageView setTransform:transform]; [UIView commitAnimations];
  • The opposite animation is obtained based on the current animation.
CGAffineTransform transform; transform = CGAffineTransformInvert (manImageView. transform); [UIView beginAnimations: @ "Invert" context: nil]; [UIView setAnimationDuration: 2]; // [UIView setAnimationDelegate: self]; [manImageView setTransform: transform]; // obtain the transform [UIView commitAnimations] of the changed view; // close the 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.