Formatted String

Using a formatted string requires loading formatted-string and span module.

import { FormattedString } from "tns-core-modules/text/formatted-string";
import { Span } from "tns-core-modules/text/span";

How to set formatted text content for a label

const label = new Label();
const formattedString = new FormattedString();
const firstSpan = new Span();

firstSpan.fontSize = 15;
firstSpan.text = "LoremIpsum";
label.formattedText = formattedString;
Is this article helpful? Yes / No
Thank you for your feedback!

Tell us how we can improve this article

NativeScript is licensed under the Apache 2.0 license .
© Progress Software Corporation. All Rights Reserved.