UIDynamicAnimator.AddBehavior(UIDynamicBehavior) Method

Definition

Adds the specified behavior to the animator.

[Foundation.Export("addBehavior:")]
public virtual void AddBehavior (UIKit.UIDynamicBehavior behavior);
abstract member AddBehavior : UIKit.UIDynamicBehavior -> unit
override this.AddBehavior : UIKit.UIDynamicBehavior -> unit

Parameters

behavior
UIDynamicBehavior

Behavior to add to the animator.

This parameter can be null.

Attributes

Remarks

The following example shows how you can add a simple behavior to an animator:

// 
// Add gravity to the "simpleView" subview, this will make it fall
//
public override void ViewDidLoad ()
{
	base.ViewDidLoad ();
	animator = new UIDynamicAnimator (View);

	animator.AddBehavior (new UIGravityBehavior (simpleView));
}

Applies to