mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
[[UIViewAnimationState]] is the manager class of [[UIView]] animation blocks. The system maintains a private global stack that contains all ''pending'' animation states. When a state is popped, the corresponding animation begins. | |||
The animations will all go back to {{fwlink|QuartzCore}} (Core Animation). | |||
== Drag coefficient == | |||
{{function signature | |||
|signature=CGFloat UIAnimationDragCoefficient(); | |||
|firmware=2.0 – | |||
}} | |||
The ''drag coefficient'' is a multiplier applied on time measurements. A large drag coefficient can slow down animations. | |||
The drag coefficient is obtained with the <tt>UIAnimationDragCoefficient()</tt> function, which in turn is an ''integer'' of the key <tt>UIAnimationDragCoefficient</tt> in the preference file <tt>~/Library/Preferences/com.apple.UIKit.plist</tt>. | |||
Drag coefficient will not affect non-UIKit animations. | |||
== Animation transitions == | == Animation transitions == | ||
Besides the default 4, the iPhoneOS identifies tons of transition effects, all value numerical value starting from 101: | |||
{| class="wikitable" | {| class="wikitable" |
Revision as of 10:18, 5 November 2009
UIViewAnimationState is the manager class of UIView animation blocks. The system maintains a private global stack that contains all pending animation states. When a state is popped, the corresponding animation begins.
The animations will all go back to QuartzCore (Core Animation).
Drag coefficient
Signature | CGFloat UIAnimationDragCoefficient(); |
---|---|
Available in | 2.0 – |
The drag coefficient is a multiplier applied on time measurements. A large drag coefficient can slow down animations.
The drag coefficient is obtained with the UIAnimationDragCoefficient() function, which in turn is an integer of the key UIAnimationDragCoefficient in the preference file ~/Library/Preferences/com.apple.UIKit.plist.
Drag coefficient will not affect non-UIKit animations.
Animation transitions
Besides the default 4, the iPhoneOS identifies tons of transition effects, all value numerical value starting from 101:
Numeric | String | Comments |
---|---|---|
0 (UIViewAnimationTransitionNone) | - | |
1 (UIViewAnimationTransitionFlipFromLeft) | oglFlip, fromLeft | |
2 (UIViewAnimationTransitionFlipFromRight) | oglFlip, fromRight | |
3 (UIViewAnimationTransitionCurlUp) | pageCurl | |
4 (UIViewAnimationTransitionCurlDown) | pageUnCurl | |
101 | pageCurl | Equivalent to UIViewAnimationTransitionCurlUp |
102 | pageUnCurl | Equivalent to UIViewAnimationTransitionCurlDown |
103 | suckEffect | Sucked to around (160, 360) on the screen. |
104 | spewEffect | Not supported? |
105 | cameraIris | You should assume the view you're operating on has a black background. |
106 | cameraIrisHollowClose | First half of cameraIris. |
107 | cameraIrisHollowOpen | Second half of cameraIris. |
108 | genieEffect | Not supported? |
109 | unGenieEffect | Not supported? |
110 | rippleEffect | |
111 | twist | Not supported? |
112 | tubey | Not supported? |
113 | swirl | Not supported? |
114 | charminUltra | Not supported? |
115 | zoomyIn | Not supported? |
116 | zoomyOut | Not supported? |
117 | oglApplicationSuspend | Not supported? |
Using suckEffect
The most SDK-compatible way of using suckEffect is to use animation blocks. But the suction point by default is close to nowhere. Therefore you still need to use the undocumented method +[UIView setAnimationPosition:]:
[UIView beginAnimations:@"suck" context:NULL];
[UIView setAnimationTransition:103 forView:myViewContainer cache:YES];
[UIView setAnimationPosition:CGPointMake(12, 345)];
[myView removeFromSuperview];
[UIView commitAnimations];
References
- All animation names: http://www.waterworld.com.hk/en/node/74
- Header: http://github.com/kennytm/iphone-private-frameworks/blob/master/UIKit/UIViewAnimationState.h