UIView.UpdateConstraints Method


Updates the Auto Layout constraints for the UIView.

[Foundation.Advice("Overriding this method requires a call to the overriden method.")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual void UpdateConstraints ();
abstract member UpdateConstraints : unit -> unit
override this.UpdateConstraints : unit -> unit


Application developers may override this method in order to create and update custom constraints for use with Auto Layout.

The Auto Layout system calls this method prior to layout. The UIView's properties will be in a stable state when this method is called and application developers should be able to establish valid constraints.

Application developers may add or remove constraints in this method. If they do so, they must call SetNeedsUpdateConstraints() to notify the Auto Layout system that further updating is required.

Application developers must not invalidate existing NSLayoutConstraints during this method. Applications developers must not perform drawing actions or invoke layout recalculation during this method.

Application developers must call base.UpdateConstraints() in their implementations of this method.

Applies to

See also