IPhoneApplicationUIView AnimationThe implementation effect is the content to be introduced in this article, mainly to introduceUIView AnimationFor more information about the presentation methods of UIView animation on the iPhone, see the documentation.) let's take a look at the details.
SetAnimationDuration:
Sets the animation duration in seconds in the animation block)
- + (void)setAnimationDuration:(NSTimeInterval)duration
Parameters
Duration
The duration of an animation.
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 0.2.
SetAnimationRepeatAutoreverses:
Set whether the animation effect in the animation block is automatically replayed.
- + (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses
Parameters
RepeatAutoreverses
If the animation is automatically repeated, YES is used; otherwise, NO is used.
Discussion
Auto-repeat indicates that the animation starts playing again after the playback ends. Use setAnimationRepeatCount: Class Method to specify the automatic animation replay time. If the number of duplicates is 0 or outside the animation block, there will be no effect. Use beginAnimations: context: Class Method to start an animation block and use the commitAnimations method to end an animation block. The default value is NO.
SetAnimationRepeatCount:
Set the number of repetitions of an animation in the animation module.
- + (void)setAnimationRepeatCount:(float)repeatCount
Parameters
RepeatCount
Number of animation repetitions. This value can be a score.
Discussion
This attribute 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 animation does not rotate.
SetAnimationsEnabled:
Set whether to activate the animation
- + (void)setAnimationsEnabled:(BOOL)enabled
Parameters
Enabled
If YES, activate the animation; otherwise, NO.
Discussion
When the animation parameter is not activated, the animation attribute changes will be ignored. The animation is activated by default.
SetAnimationStartDate:
Set the start time of the animation attribute change within the animation block.
- + (void)setAnimationStartDate:(NSDate *)startTime
Parameters
StartTime
Start time of an animation
Discussion
Use beginAnimations: context: Class Method to start an animation block and use the commitAnimations class method to end the animation block. The default start time value is returned by the CFAbsoluteTimeGetCurrent method.
SetAnimationTransition: forView: cache:
Set transition for the view in the animation Block
- + (void)setAnimationTransition:(UIViewAnimationTransition)transition forView:(UIView *)view cache:(BOOL)cache
Parameters
Transition
Apply a transition effect to the view. Possible values are defined in UIViewAnimationTransition.
View
View object to be transitioned.
Cache
If YES, rendering the Image view at the beginning and end and creating frames in the animation; otherwise, the view is rendered at each frame. For example, you do not need to update the view continuously during the view transition. You only need to wait until the conversion is complete before updating the view.
Discussion
If you want to change the appearance of a view during the transformation process. For example, the file uses the container view of a UIView subclass from one view to another, as shown below:
- Begin an animation block.
-
- Set the transition on the container view.
-
- Remove the subview from the container view.
-
- Add the new subview to the container view.
-
- Commit the animation block.
1. Start an animation block.
2. Set the conversion in the container view.
3. Remove the sub-view from the container view.
4. Add a sub-View to the container view.
5. End the animation block.
SetAnimationWillStartSelector:
Send a message to the animation proxy when the animation starts.
- + (void)setAnimationWillStartSelector:(SEL)selector
Parameters
Selector
Send messages to the animation agent before the animation starts. The default value is NULL. This selector must have the same parameters as beginAnimations: context: method, an optional program identifier and content. All these parameters can be nil.
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.
Summary: DetailsIPhoneMediumUIView AnimationThe content of the reference documents for various performance methods has been described. I hope this article will help you!