Next Page > Hide TOC

CAConstraintLayoutManager Class Reference

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

Overview

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.

Tasks

Creating the Layout Manager

Class Methods

layoutManager

Creates and returns a new CAConstraintLayoutManager instance.

+ (id)layoutManager

Return Value

A new CAConstraintLayoutManager instance.

Availability
Related Sample Code
Declared In
CAConstraintLayoutManager.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-12-11)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.