Instance Property

frame

The layer’s frame rectangle.

Declaration

@property CGRect frame;

Discussion

The frame rectangle is position and size of the layer specified in the superlayer’s coordinate space. For layers, the frame rectangle is a computed property that is derived from the values in thebounds, anchorPoint and position properties. When you assign a new value to this property, the layer changes its position and bounds properties to match the rectangle you specified. The values of each coordinate in the rectangle are measured in points.

Do not set the frame if the transform property applies a rotation transform that is not a multiple of 90 degrees.

For more information about the relationship between the frame, bounds, anchorPoint and position properties, see Core Animation Programming Guide.

See Also

Modifying the Layer Geometry

bounds

The layer’s bounds rectangle. Animatable.

position

The layer’s position in its superlayer’s coordinate space. Animatable.

zPosition

The layer’s position on the z axis. Animatable.

anchorPointZ

The anchor point for the layer’s position along the z axis. Animatable.

anchorPoint

Defines the anchor point of the layer's bounds rectangle. Animatable.

contentsScale

The scale factor applied to the layer.