UIView animation effect ---- flip. Rotate. offset. Flip. Zoom. Reverse animation effect, uiview ----
// 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];
// 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];
[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];
[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];
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.