Method 1:
View plain
- [Uiview beginanimations: @ "curl" context: Nil]; // starts the animation.
- [Uiview setanimationduration: 1.25]; // animation duration
- [Uiview setanimationcurve: uiviewanimationcurveeaseinout]; // animation speed
- [Uiview setanimationtransition: uiviewanimationtransitioncurlup // type
- Forview: Self. View
- Cache: Yes];
- [Uiview commitanimations];
Method 2:
View plain
- Catransition * animation = [catransition animation];
- [Animation setduration: 1.25f];
- [Animation settimingfunction: [camediatimingfunction functionwithname: kcamediatimingfunctioneasein];
- [Animation settype: kcatransitionreveal];
- [Animation setsubtype: kcatransitionfrombottom];
- [Self. View. layer addanimation: animation forkey: @ "reveal"];
Settype: four types can be returned:
1. kcatransitionfade fade out
2. kcatransitionmovein overwrites the source Image
3. kcatransitionpush
4. The bottom of kcatransitionreveal is shown
Setsubtype: there can also be four types:
1. kcatransitionfromright;
2. kcatransitionfromleft (default)
3. kcatransitionfromtop;
4. kcatransitionfrombottom
There is also a way to set the animation type, without setsubtype, only settyp
View plain
- [Animation settype: @ "suckeffect"];
Note:
After wasting a lot of time and patience, it is tested that only the following types are available now:
Suckeffect (triangle)
Rippleeffect)
Pagecurl)
Pageuncurl (Flip-down)
Oglflip (up/down flip)
Camerairis/camerairishollowopen/camerairishollowclose
The following is a blacklist:
Speweffect: the new layout is released in the middle of the screen to overwrite the old layout.
-Genieeffect: the old version is sucked out at the lower left or lower right of the screen to display the new layout (Aladdin lamp God?) below ?).
-Ungenieeffect: the new layout is released in the lower left or lower right corner of the screen to overwrite the old layout.
-Twist: the layout is transferred horizontally like a tornado.
-Tubey: the layout is vertically attached with an elastic transfer.
-Swirl: the old version rotates at 360 degrees and fades out to display a new layout.
-Charminultra: the old version fades out and displays the new layout.
-Zoomyin: the new layout goes from small to front, and the old version disappears from front to front.
-Zoomyout: zoomyout appears outside the screen of the new layout, and the earlier version disappears.
-Oglapplicationsuspend: the effect of pressing the "home" button.
Also, mapcurl and mapuncurl
The constant variables of the five predefined time functions are
Kcamediatimingfunctionlinear,
Kcamediatimingfunctioneasein,
Kcamediatimingfunctioneaseout,
Kcamediatimingfunctioneaseineaseout,
Kcamediatimingfunctiondefault.
The curve of the preceding four timing functions is displayed. The horizontal coordinates represent the time and the vertical coordinates represent the change volume. This need to be clarified (not the XY in the plane coordinate system ).
The function image of the custom timing function is a cubic betel curve (cubic bezercurve). The advantage of the betel curve is that it is smooth, and the changes appear smooth here. A Cubic besell curve can be determined by the starting point and the two control points.
The above kcamediatimingfunctiondefault function curve is actually through [(0.0, 0.0), (0.25, 0.1), (0.25, 0.1), (1.0, 1.0)] the three besell curves determined by these four points. The beginning and end are the start point and the end point, and the two points in the middle are the control points.
P0 is the starting point, P3 is the ending point, and P1 and P2 are two control points.
If the time-varying curve is neither a straight line nor a beiser curve, but a custom curve, or the trajectory of a layer movement is not a straight line but a curve, these are basically impossible for animation, therefore, the following content is introduced, namely, the key frame animation.