iOS Guides | Samples

UIKit.UIDynamicBehavior Class

The base class for items that describe the physics-like behaviors of UIKit Dynamics, introduced in iOS 7.

See Also: UIDynamicBehavior


[Foundation.Register("UIDynamicBehavior", true)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public class UIDynamicBehavior : NSObject


A number of UIDynamicBehaviors are associated with a UIDynamicAnimator, which is responsible for the overall context. Any given UIDynamicBehavior is associated with some amount of IUIDynamicItems (such as UIViews and UICollectionViewLayoutAttributes); most subclasses of UIDynamicBehavior expose these in an Items property or application developers can retrieve them with UIDynamicAnimator.GetDynamicItems.

There are a number of predefined subclasses of UIDynamicBehavior:

UIAttachmentBehavior Attachment: Specifies a dynamic connection between two IUIDynamicItems or between a IUIDynamicItem and a fixed point.
UICollisionBehavior Collision: Detects when the boundaries of a IUIDynamicItem meet another boundary.
UIGravityBehavior Gravity: Accelerates the IUIDynamicItem towards the bottom of the screen.
UIDynamicItemBehavior Animation: Specifies an animation configuration to apply to one or more IUIDynamicItems.
UIPushBehavior Pushing: Applies a continuous or instantaneous force vector to a IUIDynamicItem.
UISnapBehavior Snapping: Specifies a magnetism-like attraction between a IUIDynamicItem and a fixed point. Includes a rebounding effect.

Related content


Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions:

The members of UIKit.UIDynamicBehavior are listed below.

See Also: NSObject

Public Constructors

Default constructor, initializes a new instance of this class.

Protected Constructors

Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

ActionAction. The NSAction that executes during dynamic animation.
ChildBehaviorsUIDynamicBehavior[]. The children UIDynamicBehaviors of this UIDynamicBehavior. Read-only.
ClassHandleIntPtr. The handle for this class.
DynamicAnimatorUIDynamicAnimator. The UIDynamicAnimator associated with this UIDynamicBehavior. Read-only.

Public Methods

Adds a UIDynamicBehavior to this UIDynamicBehavior's ChildBehaviors.
Removes a UIDynamicBehavior from this UIDynamicBehavior's ChildBehaviors.
Indicates that this UIDynamicBehavior has been added or removed from a UIDynamicAnimator.