inherits from |
caanimation&nb Sp;: nsobject |
conforms to |
nscoding (caanimation) nscopying (caanimation) caaction ( caanimation) camediatiming (caanimation) nsobject (nsobject) |
framework |
/system/library/fra Meworks/quartzcore.framework |
availability |
Available in IOS 2.0 and later. |
declared in |
caanimation.h |
The Catransition class implements the transition animation for the layer. You can specify transition effects from a set of predefined transformations or by providing a custom cifilter instance.
[Plain]View Plaincopy
- Define a transition animation
- Catransition *animation = [catransition animation];
- Transition animation Duration
- Animation.duration = 0.2f;
- Timing function, from beginning to end fluency???
- Animation.timingfunction=uiviewanimationcurveeaseinout;
- Transition animation Type
- Animation.type = Kcatransitionreveal;
- The direction the transition animation will go
- Animation.subtype = Kcatransitionfrombottom;
- The implementation you need when animating
- Self.tabBarController.tabBar.hidden = YES;
- Add animations (transition animations are animations added on a layer)
- Self.tabBarController.tabBar.layer addanimation:animation forkey:@ "animation"];
Description
duration: How long the animation lasts.
timingfunction: I don't understand (who understands that)
Type: Types of transition animations. If you specify a filter property in a custom transition animation, this property is ignored.
There are four types of type:
NSString * Const kcatransitionfade;//gradually disappears NSString * Const kcatransitionmovein;//MOVE in NSString * Const kcatransitionpush;// Translate (so call it) NSString * Const kcatransitionreveal;//revealed
The default type is Kcatransitionfade.
subtype: The direction in which the transition animation will go.
There are four types of Subtpye:
NSString * Const kcatransitionfromright; NSString * Const Kcatransitionfromleft; NSString * Const Kcatransitionfromtop; NSString * Const Kcatransitionfrombottom;
The default direction is nil.
[Self.tabBarController.tabBar.layer addanimation:animation forkey:@ "animation"];
transition animations are added to the layer!
The following several transition animation calls the Apple's private API, note, carefully used after the Apple called back.
[Plain]View Plaincopy
- Switch (Btn.tag) {
- Case 0:
- Animation.type = @ "cube";//---Cube
- Break
- Case 1:
- Animation.type = @ "Suckeffect";//103 suck-away effect
- Break
- Case 2://before and after rollover effect
- Animation.type = @ "Oglflip";//when subtype is "Fromleft" or "fromright", it ' s the official one.
- Break
- Case 3:
- Animation.type = @ "Rippleeffect";//110 Ripple Effect
- Break
- Case 4:
- Animation.type = @ "Pagecurl";//101 page Up
- Break
- Case 5:
- Animation.type = @ "Pageuncurl";//102 PAGE Down
- Break
- Case 6:
- Animation.type = @ "Camerairishollowopen";//107//Lens Open
- Break
- Case 7:
- Animation.type = @ "Camerairishollowclose";//106 lens off
- Break
- Default
- Break
- }