nativescript-htmllabel
TypeScript icon, indicating that this package has built-in type declarations

1.0.41 • Public • Published

# NativeScript Label widget npm downloads npm downloads npm

A NativeScript Label widget. It is a direct replacement for the {N} Label widget.

Installation

Run the following command from the root of your project:

tns plugin add nativescript-htmllabel

This command automatically installs the necessary files, as well as stores nativescript-htmllabel as a dependency in your project's package.json file.

Configuration

It works exactly the same way as the {N} plugin. However it adds a few improvements

iOS Performances

On iOS generating html string can be slow using the system way. You can enable DTCoreText to make it faster.

  • add pod DTCoreText in your app Podfile at App_Resources/ios
pod 'DTCoreText'
  • enable it in your app.(js|ts) (as soon as possible)
require('nativescript-htmlabel').enableIOSDTCoreText();

Properties

  • html
    Html text that will be used to render text. HTML supported tags are a bit different on iOS and Android. To make sure it works as expected, for now only used Android supported ones

  • verticalTextAlignment
    You can also set it through css with vertical-text-alignment

  • textShadow
    You can also set it through css with text-shadow. The format is offsetx offsety blurradius color

Improvements

  • Override the {N} font loading system to make it much faster
  • faster creation of FormattedString
  • faster label creation and drawing, especially on android

Package Sidebar

Install

npm i nativescript-htmllabel

Weekly Downloads

1

Version

1.0.41

License

Apache-2.0

Unpacked Size

207 kB

Total Files

25

Last publish

Collaborators

  • farfromrefuge