UIView, flip, rotate, offset, flip, zoom, invert animation effects[OBJC]View PlainCopy
- Start animation
- [UIView beginanimations:@ "Doflip" context: nil];
- //settings are often
- [UIView setanimationduration:1];
- //Set animation fade
- [UIView setanimationcurve:uiviewanimationcurveeaseinout];
- //Set up proxy
- [UIView setanimationdelegate: Self];
- //Set Flip direction
- [UIView setanimationtransition:
- Uiviewanimationtransitionflipfromleft forview:manimageview cache:YES];
- //End of animation
- [UIView commitanimations];
Rotate animation[OBJC]View PlainCopy
- Create a Cgaffinetransform Transform object
- Cgaffinetransform transform;
- Set Rotation degree
- Transform = Cgaffinetransformrotate (Manimageview. transform,m_pi/6. 0);
- Animation start
- [UIView beginanimations:@ "Rotate" context: nil];
- Animations are often
- [UIView setanimationduration:2];
- Add Agent
- [UIView setanimationdelegate: Self];
- Gets the value of the transform
- [Manimageview Settransform:transform];
- Turn off animations
- [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
- [UIView beginanimations:@ "Curlup" context: nil];
- [UIView setanimationcurve:uiviewanimationcurveeaseinout]; //Specifies the animation curve type, which is the default, linear is constant speed
- //Set animations often
- [UIView setanimationduration:1];
- [UIView setanimationdelegate: Self];
- //Set the direction of page flipping
- [UIView setanimationtransition:uiviewanimationtransitioncurlup forview:manimageview cache:YES];
- //Close animation
- [UIView commitanimations];
Zoom Animation
[OBJC]View PlainCopy
- 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 inverse animation effect is to take his opposite animation according to the current animation
[OBJC]View PlainCopy
- Cgaffinetransform transform;
- Transform=cgaffinetransforminvert (Manimageview. Transform);
- [UIView beginanimations:@ "Invert" context: nil];
- [UIView setanimationduration:2]; Animations are often
- [UIView setanimationdelegate: Self];
- [Manimageview Settransform:transform]; //Get the transform of the changed view
- [UIView commitanimations]; //Close animation
iOS Development Animation (Animation) Summary