An open API service indexing awesome lists of open source software.

https://github.com/nericode/nativescript-text-justify


https://github.com/nericode/nativescript-text-justify

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# Text Justify ![apple](https://cdn3.iconfinder.com/data/icons/picons-social/57/16-apple-32.png) ![android](https://cdn4.iconfinder.com/data/icons/logos-3/228/android-32.png)

## Installation

Ideally it would be something like:

```javascript
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 > assets > fonts > .ttf`

Show demo for more info.

```xml




```

## Angular

Add element in `app.module.ts`:

```ts
import { registerElement } from "nativescript-angular/element-registry";
import { TextJustify } from "nativescript-text-justify";

registerElement("TextJustify", () => TextJustify);
```

In .html:

```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