UIKit.UIView.Constraints Property
The constraints used by Auto Layout on this UIKit.UIView.

Syntax

[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_6_0)]
[get: Foundation.Export("constraints")]
[get: ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_6_0)]
public virtual NSLayoutConstraint[] Constraints { get; }

See Also

UIView.AddConstraint
UIView.AddConstraints
UIView.RemoveConstraint
UIView.RemoveConstraints
UIView.TranslatesAutoresizingMaskIntoConstraints

Value

The default value is an empty array.

Remarks

Auto Layout uses the UIView.Constraints of a UIKit.UIView to lay out its UIView.Subviews. These constraints are set with UIView.AddConstraint or UIView.AddConstraints.

The NSLayoutConstraint.DebugDescription property can be helpful in debugging Auto Layout issues.

C# Example

foreach(var c in mainView.Constraints)
{
    Console.WriteLine(c.DebugDescription);
}              
              

Requirements

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