public class NSLayoutConstraint extends NSObject
| Modifier and Type | Method and Description |
|---|---|
static void |
activateConstraints(List<NSLayoutConstraint> constraints)
Activates all the constraints of the specified list.
|
double |
constant()
Returns the constant that is added to the multiplied second attribute of
the constraint.
|
static List<NSLayoutConstraint> |
constraintsWithVisualFormat(String format,
int NSLayoutFormatOptions,
Map<String,Float> metrics,
Map<String,UIView> views)
Creates and returns a list of constraints using the specified ASCII
visual format string.
|
static NSLayoutConstraint |
constraintWithItem(Object view1,
int NSLayoutAttribute1,
int NSLayoutRelation,
Object view2,
int NSLayoutAttribute2,
double multiplier,
double constant)
Constructs and returns a constraint for the attributes of the specified
views.
|
static void |
deactivateConstraints(List<NSLayoutConstraint> constraints)
Deactivates all the constraints of the specified list.
|
int |
firstAttribute()
Returns the attribute of the first object of the constraint.
|
Object |
firstItem()
Returns the first object of the constraint.
|
String |
identifier()
Returns the id of this NSLayoutConstraint.
|
boolean |
isActive()
Returns the state of this constraint.
|
double |
multiplier()
Returns the multiplier of the second attribute of the constraint.
|
float |
priority()
Returns the priority of the constraint.
|
int |
relation()
Returns the relation between the items of the constraint.
|
int |
secondAttribute()
Returns the second attribute of the constraint.
|
Object |
secondItem()
Returns the second item of the constraint.
|
void |
setActive(boolean active)
Sets the state of this constraint.
|
void |
setConstant(double constant)
Sets the constant that is added to the multiplied second attribute of the
constraint.
|
void |
setIdentifier(String identifier)
Set the id of this NSLayoutConstraint.
|
void |
setPriority(float UILayoutPriority)
Sets the priority of the constraint.
|
void |
setShouldBeArchived(boolean shouldBeArchived)
Set a Boolean that defines whether this NSLayoutConstraint should be
archived by its owning view.
|
boolean |
shouldBeArchived()
Returns a Boolean that shows whether this NSLayoutConstraint is archived
by its owning view.
|
String |
toString() |
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKeypublic static List<NSLayoutConstraint> constraintsWithVisualFormat(String format, int NSLayoutFormatOptions, Map<String,Float> metrics, Map<String,UIView> views)
format - The specification of the constraints.NSLayoutFormatOptions - The NSLayoutFormat options of the objects.metrics - The constants of the visual format string.views - The views of the visual format string.NSLayoutFormatOptionspublic static NSLayoutConstraint constraintWithItem(Object view1, int NSLayoutAttribute1, int NSLayoutRelation, Object view2, int NSLayoutAttribute2, double multiplier, double constant)
view1 - The view of the left side of the constraint.NSLayoutAttribute1 - The attribute of the view for the left side of
the constraint.NSLayoutRelation - The relationship between the two sides of the
constraint.view2 - The view of the right side of the constraint.NSLayoutAttribute2 - The attribute of the view for the right side of
the constraint.multiplier - The multiplier of the attribute on the right side of
the constraint.constant - The constant added to the multiplied attribute value on
the right side of the constraint.public static void activateConstraints(List<NSLayoutConstraint> constraints)
constraints - The list of constraints that should be activated.public static void deactivateConstraints(List<NSLayoutConstraint> constraints)
constraints - The list of constraints that should be deactivated.public boolean isActive()
public void setActive(boolean active)
active - TRUE then the constraint is active.public float priority()
UILayoutPrioritypublic void setPriority(float UILayoutPriority)
UILayoutPriority - The priority of the constraint.UILayoutPrioritypublic Object firstItem()
public int firstAttribute()
public int relation()
public Object secondItem()
public int secondAttribute()
public double multiplier()
public double constant()
public void setConstant(double constant)
constant - The constant that is added to the multiplied second
attribute of the constraint.public String identifier()
public void setIdentifier(String identifier)
identifier - The id of this NSLayoutConstraint.public boolean shouldBeArchived()
public void setShouldBeArchived(boolean shouldBeArchived)
shouldBeArchived - TRUE then this NSLayoutConstraint should be
archived by its owning view.Copyright © 2020. All rights reserved.