IPhoneApplicationUIView AnimationThe implementation effect is the content to be introduced in this article, mainly to introduceUIView AnimationFirst, let's look at the details.
Returns a Boolean value indicating whether the animation ends.
- + (BOOL)areAnimationsEnabled
Return Value
If the animation ends, YES is returned; otherwise, NO is returned.
- beginAnimations:context:
Start an animation Block
- + (void)beginAnimations:(NSString *)animationID context:(void *)context
Parameters
AnimationID
The internal application identifier of the animation block is used to pass the message to the animation proxy-This selector is set using setAnimationWillStartSelector: And setAnimationDidStopSelector.
Context
The additional application information is used to pass the message to the animation proxy-This selector uses setAnimationWillStartSelector: And setAnimationDidStopSelector: method.
Discussion
This value is changed because some attributes that need to be generated in the animation block are set. Animation blocks can be nested. If it is not called in an animation block, the setAnimation class method will do nothing. Use beginAnimations: context: to start an animation block and use the commitAnimations class method to end an animation block.
CommitAnimations
End an animation block and start when it is outside the animation block.
- + (void)commitAnimations
Discussion
If the current animation block is the outermost animation block, the animation block starts when the application returns to the loop. All applications of an animation in an independent thread will not be interrupted. With this method, multiple animations can be implemented. View the setAnimationBeginsFromCurrentState: to learn if an animation starts when another animation is playing.
LayerClass
The returned class is used to create a layer instance object of this class.
- + (Class)layerClass
Return Value
A class used to create a view layer
Discussion
Override subclass to specify a custom class for display. Called when creating a view layer. The default value is a CALayer class object.
SetAnimationBeginsFromCurrentState
:
Set the animation to start playing from the current status.
- + (void)setAnimationBeginsFromCurrentState:(BOOL)fromCurrentState
Parameters
FromCurrentState
YES if the animation needs to be played from their current status. Otherwise, it is NO.
Discussion
If it is set to YES, when the animation is running, the current view position will be used as the starting state of the new animation. If it is set to NO, the new animation uses the position of the last state of the view as the start state before the current animation ends. This method will not do anything if the animation is not running or not called outside the animation block. Use beginAnimations: context: Class Method to start and use the commitAnimations class method to end the animation block. The default value is NO.
SetAnimationCurve
:
Set the curve of the animation attribute change in the animation block.
- + (void)setAnimationCurve:(UIViewAnimationCurve)curve
Discussion
The animation curve is the relative speed during the animation operation. This method will be invalid if it is called outside the animation block. Use beginAnimations: context: Class Method to start an animation block and use commitAnimations to end the animation block. The default animation curve value is UIViewAnimationCurveEaseInOut.
SetAnimationDelay:
Set the animation delay attribute in seconds in the animation block)
- + (void)setAnimationDelay:(NSTimeInterval)delay
Discussion
This method is invalid when it is called outside the animation block. Use beginAnimations: context: Class Method to start an animation block and use the commitAnimations class method to end the animation block. The default animation delay is 0.0 seconds.
SetAnimationDelegate:
Sets the animation message proxy.
- + (void)setAnimationDelegate:(id)delegate
Parameters
Delegate
You can use setAnimationWillStartSelector: And setAnimationDidStopSelector: to set the object for receiving proxy messages.
Discussion
This method has no effect on the animation block. Use beginAnimations: context: Class Method to start an animation block and use the commitAnimations class method to end an animation block. The default value is nil.
SetAnimationDidStopSelector:
Set the message to the animation proxy when the animation is stopped.
- + (void)setAnimationDidStopSelector:(SEL)selector
Parameters
Selector
Send the animation to the animation proxy when the animation ends. The default value is NULL. The selector must have the signature of the following method: animationFinished :( NSString *) animationID finished :( BOOL) finished context :( void *) context.
AnimationID
The identifier provided by an application. Same as beginAnimations: context. This parameter can be blank.
Finished
If the animation is completed before it is stopped, YES is returned; otherwise, NO is returned.
Context
An optional application content provider. Same as beginAnimations: context: method. It can be null.
Discussion
This method has no effect on the animation block. Use beginAnimations: context: Class Method to start an animation block and end with the commitAnimations class method. The default value is NULL.
Summary: DetailsIPhoneMediumUIView AnimationI hope this article will help you with the introduction of various performance methods! If youIPhoneMediumUIView AnimationFor more information, see:
For details about how UIView animations are displayed on the iPhone, refer to the documentation)