This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

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

2.0.0 • Public • Published

Text Justify apple android

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.

<Page
    xmlns="http://schemas.nativescript.org/tns.xsd"
    xmlns:textJustify="nativescript-text-justify"
    loaded="pageLoaded">
    <StackLayout>
        <textJustify:TextJustify
            textColor="black"
            textSize="22"
            textAlignment="true"
            textTypefacePath="robotoitalic.ttf"
            text="This text is for test, This text is for test, This text is for test, This text is for test.">
        </textJustify:TextJustify>
    </StackLayout>
</Page>

Angular

Add element in app.module.ts:

import { registerElement } from "nativescript-angular/element-registry";
import { TextJustify } from "nativescript-text-justify";
 
registerElement("TextJustify", () => TextJustify);

In .html:

<TextJustify
    textColor="black"
    textSize="22"
    textAlignment="true"
    textTypefacePath="robotoitalic.ttf"
    text="This text is for test, This text is for test, This text is for test, This text is for test."
>
</TextJustify>

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

Package Sidebar

Install

npm i nativescript-text-justify

Weekly Downloads

3

Version

2.0.0

License

Apache-2.0

Unpacked Size

107 kB

Total Files

16

Last publish

Collaborators

  • alanneri