Class

CATextLayer

A layer that provides simple text layout and rendering of plain or attributed strings.

Declaration

@interface CATextLayer : CALayer

Overview

The first line is aligned to the top of the layer.

Topics

Getting and Setting the Text

string

The text to be rendered by the receiver.

Text Visual Properties

font

The font used to render the receiver’s text.

fontSize

The font size used to render the receiver’s text. Animatable.

foregroundColor

The color used to render the receiver’s text. Animatable.

allowsFontSubpixelQuantization

Determines whether to allow subpixel quantization for the graphics context used for text rendering.

Text Alignment and Truncation

wrapped

Determines whether the text is wrapped to fit within the receiver’s bounds.

alignmentMode

Determines how individual lines of text are horizontally aligned within the receiver’s bounds.

truncationMode

Determines how the text is truncated to fit within the receiver’s bounds.

Constants

Truncation modes

These constants are used by the truncationMode property.

Horizontal alignment modes

These constants are used by the alignmentMode property.

Relationships

Inherits From

See Also

Text, Shapes, and Gradients

CAShapeLayer

A layer that draws a cubic Bezier spline in its coordinate space.

CAGradientLayer

A layer that draws a color gradient over its background color, filling the shape of the layer (including rounded corners)

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software