Upravit

Sdílet prostřednictvím


NSLayoutConstraint.FromVisualFormat Method

Definition

Overloads

FromVisualFormat(String, NSLayoutFormatOptions, Object[])

Factory method for creating a constraint using Visual Format Language.

FromVisualFormat(String, NSLayoutFormatOptions, NSDictionary, NSDictionary)

Factory method for creating a constraint using Visual Format Language.

FromVisualFormat(String, NSLayoutFormatOptions, Object[])

Factory method for creating a constraint using Visual Format Language.

public static UIKit.NSLayoutConstraint[] FromVisualFormat (string format, UIKit.NSLayoutFormatOptions formatOptions, params object[] viewsAndMetrics);
static member FromVisualFormat : string * UIKit.NSLayoutFormatOptions * obj[] -> UIKit.NSLayoutConstraint[]

Parameters

format
String

Visual format to use to create the constraints.

formatOptions
NSLayoutFormatOptions

options.

viewsAndMetrics
Object[]

Pairs of names and values. The names should be strings (or NSStrings) and the values should be either UIViews, numbers (any C# number or NSNumber) or INativeObject instances that are suitable to be passed to the underlying engine. 

 This binds the provided name with the view or binds the name with the number as a metric.

Returns

An array of layout constraints that are suitable to be added to a UIView using AddConstraints(NSLayoutConstraint[]) method.

Remarks

NSLayoutConstraint.FromVisualFormat ("|-8-[messageView]-8-|", NSLayoutOptions.None, "messageView", MakeMessageView ());

Applies to

FromVisualFormat(String, NSLayoutFormatOptions, NSDictionary, NSDictionary)

Factory method for creating a constraint using Visual Format Language.

[Foundation.Export("constraintsWithVisualFormat:options:metrics:views:")]
public static UIKit.NSLayoutConstraint[] FromVisualFormat (string format, UIKit.NSLayoutFormatOptions formatOptions, Foundation.NSDictionary metrics, Foundation.NSDictionary views);
static member FromVisualFormat : string * UIKit.NSLayoutFormatOptions * Foundation.NSDictionary * Foundation.NSDictionary -> UIKit.NSLayoutConstraint[]

Parameters

format
String

Visual format to use to create the constraints.

formatOptions
NSLayoutFormatOptions

options.

metrics
NSDictionary

Dictionary containing mapping names to numbers, where each name is associated with the given metric.

This parameter can be null.

views
NSDictionary

Dictionary containing mappings of names to UIViews.

Returns

An array of layout constraints that are suitable to be added to a UIView using AddConstraints(NSLayoutConstraint[]) method.

Attributes

Remarks

It is easier to use the FromVisualFormat(String, NSLayoutFormatOptions, Object[]) overload as it combines support for both metrics and views in a single call.

Applies to