UIView.Constraints Property
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.
The constraints used by Auto Layout on this UIView.
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual UIKit.NSLayoutConstraint[] Constraints { [Foundation.Export("constraints")] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.Constraints : UIKit.NSLayoutConstraint[]
Property Value
The default value is an empty array.
- Attributes
Remarks
Auto Layout uses the Constraints of a UIView to lay out its Subviews. These constraints are set with AddConstraint(NSLayoutConstraint) or AddConstraints(NSLayoutConstraint[]).
The P:UIKit.NSLayoutConstraint.DebugDescription property can be helpful in debugging Auto Layout issues.
foreach(var c in mainView.Constraints)
{
Console.WriteLine(c.DebugDescription);
}
Applies to
See also
- <xref:UIKit.UIView.AddConstraint>
- <xref:UIKit.UIView.AddConstraints>
- <xref:UIKit.UIView.RemoveConstraint>
- <xref:UIKit.UIView.RemoveConstraints>
- TranslatesAutoresizingMaskIntoConstraints