Instance Method

resizeWithOldSuperlayerSize:

Informs the receiver that the size of its superlayer changed.

Declaration

- (void)resizeWithOldSuperlayerSize:(CGSize)size;

Parameters

size

The previous size of the superlayer.

Discussion

When the autoresizingMask property is used for resizing and the bounds of a layer change, that layer calls this method on each of its sublayers. Sublayers use this method to adjust their own frame rectangles to reflect the new superlayer bounds, which can be retrieved directly from the superlayer. The old size of the superlayer is passed to this method so that the sublayer has that information for any calculations it must make.

See Also

Managing Layer Resizing and Layout

layoutManager

The object responsible for laying out the layer’s sublayers.

- setNeedsLayout

Invalidates the layer’s layout and marks it as needing an update.

- layoutSublayers

Tells the layer to update its layout.

- layoutIfNeeded

Recalculate the receiver’s layout, if required.

- needsLayout

Returns a Boolean indicating whether the layer has been marked as needing a layout update.

autoresizingMask

A bitmask defining how the layer is resized when the bounds of its superlayer changes.

- resizeSublayersWithOldSize:

Informs the receiver’s sublayers that the receiver’s size has changed.

- preferredFrameSize

Returns the preferred size of the layer in the coordinate space of its superlayer.