- axis
- The direction of interest.
The default value is an empty array.
This is a debugging method that should not be used in production applications.
The returned array may contain UIKit.NSLayoutConstraints that do not explicitly reference this UIKit.UIView but which nonetheless affect the UIView.Frame. For instance, if this is pinned to anotherView and anotherView is pinned to it's UIView.Superview, the method may return both constraints.
This method is a debugging oriented helper method and is not guaranteed to return the complete set (or any) UIKit.NSLayoutConstraints.
If this method is called directly from within UIViewController.ViewDidLoad, it will generally return an empty array. If it is invoked as shown in the following example, it appears to be more likely to provide a comprehensive answer.
C# Example
mainView.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:|-[blue]-|", 0, new NSDictionary(), viewsDictionary));
mainView.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-[blue]-(==30)-[green(==blue)]-|", 0, new NSDictionary(), viewsDictionary));
mainView.AddConstraints(NSLayoutConstraint.FromVisualFormat("|-[green(==blue)]-|", 0, new NSDictionary(), viewsDictionary));
System.Threading.ThreadPool.QueueUserWorkItem(delegate {
InvokeOnMainThread(delegate {
foreach(var c2 in blueView.GetConstraintsAffectingLayout(UILayoutConstraintAxis.Horizontal))
{
Console.WriteLine(c2);
}
});
});