UIView.Animate Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Animate(Double, Action) |
Animates the property changes that take place in the specified action. |
Animate(Double, Action, Action) |
Animates the property changes that take place in the specified action and invokes a completion callback when the animation completes. |
Animate(Double, Double, UIViewAnimationOptions, Action, Action) |
Invokes animation changes to one or more views by specifying duration, delay, options, and a completion handler. |
Animate(Double, Action)
Animates the property changes that take place in the specified action.
[Foundation.Export("animateWithDuration:animations:")]
public static void Animate (double duration, Action animation);
static member Animate : double * Action -> unit
Parameters
- duration
- Double
Duration in seconds for the animation.
- animation
- Action
Code containing the changes that you will apply to your view.
- Attributes
Remarks
The use of this method is discouraged. Application developers should prefer to use the UIViewPropertyAnimator class to animate UIViews.
This uses the CurveEaseOut and TransitionNone flags for the animation.
// Animates hiding the label by setting the alpha to zero over three seconds.
UIView.Animate (3, () => { label.Alpha = 0; });
Applies to
Animate(Double, Action, Action)
Animates the property changes that take place in the specified action and invokes a completion callback when the animation completes.
[Foundation.Advice("Use the *Notify method that has 'UICompletionHandler completion' parameter, the 'bool' will tell you if the operation finished.")]
public static void Animate (double duration, Action animation, Action completion);
static member Animate : double * Action * Action -> unit
Parameters
- duration
- Double
Duration in seconds for the animation.
- animation
- Action
Code containing the changes that you will apply to your view.
- completion
- Action
Code that is invoked when the animation completes.
- Attributes
Remarks
The use of this method is discouraged. Application developers should prefer to use the UIViewPropertyAnimator class to animate UIViews.
This uses the CurveEaseOut and TransitionNone flags for the animation.
// Animates hiding the label by setting the alpha to zero over three seconds.
UIView.Animate (3, () => { label.Alpha = 0; });
Applies to
Animate(Double, Double, UIViewAnimationOptions, Action, Action)
Invokes animation changes to one or more views by specifying duration, delay, options, and a completion handler.
[Foundation.Advice("Use the *Notify method that has 'UICompletionHandler completion' parameter, the 'bool' will tell you if the operation finished.")]
public static void Animate (double duration, double delay, UIKit.UIViewAnimationOptions options, Action animation, Action completion);
static member Animate : double * double * UIKit.UIViewAnimationOptions * Action * Action -> unit
Parameters
- duration
- Double
Duration in seconds for the animation.
- delay
- Double
Delay before the animation begins.
- options
- UIViewAnimationOptions
Animation options
- animation
- Action
Code containing the changes that you will apply to your view.
- completion
- Action
Code that is invoked when the animation completes.
- Attributes
Remarks
The use of this method is discouraged. Application developers should prefer to use the UIViewPropertyAnimator class to animate UIViews.
This method initiates a set of animations that areto be performed on this view. The action indicated in the animations parameter contains the code for the animation of the properties of one or more views.