Edit

Share via


CATextLayer.AttributedString Property

Definition

Sets the attributed string to display.

public Foundation.NSAttributedString AttributedString { get; set; }
member this.AttributedString : Foundation.NSAttributedString with get, set

Property Value

Remarks

This sets the attributed string to display on the layer. The attributed string should contain CoreText attributes.

void DrawHelloWorld (CATextLayer myTextLayer)
{
    var hello = new NSAttributedString ("Hello, world",
           new CTStringAttributes () {
                  ForegroundColorFromContext =  true,
                  Font = new CTFont ("Arial", 24)
           });

    myTextLayer.AttributedString = hello;
}    

Applies to