2.0.0 • Published 5 years ago

nativescript-text-justify v2.0.0

Weekly downloads
7
License
Apache-2.0
Repository
-
Last release
5 years ago

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)DefaultDescription
texttext: stringSet the text
alignmentalignment: booleanSet true for justified or false
textSizetextSize: numberSet textSize 1 and <= 23
textColortextColor: stringSet textColor #RRGGBB 'white', 'black', etc..
textTypefacePathtextTypefacePath: stringSet textTypefacePath example: roboto.ttf
Property (iOS)DefaultDescription
texttext: stringSet the text
alignmentalignment: booleanSet true for justified or false
colorcolor: stringSet textColor #RRGGBB 'white', 'black', etc..
textWraptextWrap: booleanProperty of Label
fontSizefontSize: numberProperty of Label

License

Apache License Version 2.0, January 2004

2.0.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago