Installation
Ideally it would be something like:
tns plugin add nativescript-text-justify
Usage
Only Android
To establish a font type, it is necessary to create a directory assets > fonts
with the fonts to be used:
Directory:
App_Resources > Android > src > main > <create paths> assets > fonts > <name>.ttf
Show demo for more info.
Angular
Add element in app.module.ts
:
;; registerElement"TextJustify",TextJustify;
In .html:
API
Property (Android) | Default | Description |
---|---|---|
text | text: string | Set the text |
alignment | alignment: boolean | Set true for justified or false |
textSize | textSize: number | Set textSize 1 and <= 23 |
textColor | textColor: string | Set textColor #RRGGBB 'white', 'black', etc.. |
textTypefacePath | textTypefacePath: string | Set textTypefacePath example: roboto.ttf |
Property (iOS) | Default | Description |
---|---|---|
text | text: string | Set the text |
alignment | alignment: boolean | Set true for justified or false |
color | color: string | Set textColor #RRGGBB 'white', 'black', etc.. |
textWrap | textWrap: boolean | Property of Label |
fontSize | fontSize: number | Property of Label |
License
Apache License Version 2.0, January 2004