Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/QuartzCore.framework |
Availability | Available in Mac OS X v10.5 and later. |
Declared in | CAConstraintLayoutManager.h |
Companion guides | |
Related sample code |
CAConstraintLayoutManager
provides a constraint-based layout manager.
Constraint-based layout allows you to describe the position and size of a layer by specifying relationships between a layer and its sibling layers or its superlayer. The relationships are represented by instances of the CAConstraint
class that are stored in an array in the layer’s constraints
property. You add constraints for a layer using its addConstraint:
method. Each CAConstraint
instance encapsulates one geometry relationship between two layers. Layout is then performed by fetching the constraints of each sublayer and solving the resulting system of constraints for the frame of each sublayer starting from the bounds of the containing layer.
Sibling layers are referenced by name, using the name
property of each layer. The special name superlayer
is used to refer to the layer's superlayer.
Important: It is possible to specify a set of constraints for a layer (for example, circular attribute dependencies) that will cause layout to fail. In that case the behavior is undefined.
Creates and returns a new CAConstraintLayoutManager
instance.
+ (id)layoutManager
A new CAConstraintLayoutManager
instance.
CAConstraintLayoutManager.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-12-11)