UIView.CommitAnimations 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.
Indicates the end of an animation block.
[Foundation.Export("commitAnimations")]
public static void CommitAnimations ();
static member CommitAnimations : unit -> unit
- Attributes
Remarks
The use of this method is discouraged. Application developers should prefer to use the UIViewPropertyAnimator class to animate UIViews.
Older versions of iOS used a matched set of BeginAnimations(String, IntPtr) and CommitAnimations() to specify an animation block. The following code, taken from the "Animate a UIView using UIKit" recipe, shows the technique:
UIView.BeginAnimations ("slideAnimation");
UIView.SetAnimationDuration (2);
UIView.SetAnimationCurve (UIViewAnimationCurve.EaseInOut);
UIView.SetAnimationRepeatCount (2);
UIView.SetAnimationRepeatAutoreverses (true);
UIView.SetAnimationDelegate (this);
UIView.SetAnimationDidStopSelector (
new Selector ("slideAnimationFinished:"));
_imageView.Center = new PointF (UIScreen.MainScreen.Bounds.Right -
_imageView.Frame.Width / 2, _imageView.Center.Y);
UIView.CommitAnimations ();
Applies to
See also
- <xref:UIKit.UIView.BeginAnimations>
- https://developer.xamarin.com/ios/Recipes/Animation/CoreAnimation/Animate_a_UIView_using_UIKit