nativescript-auto-fit-label
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

AutoFitText

This plugin is based on the Nativescript Label implementation but with changes to adjust the font size according of the label's width

Example Image

Prerequisites / Requirements

This plugin is only tested with {N} > 3.0.0

Installation

Describe your plugin installation steps. Ideally it would be something like:

tns plugin add nativescript-auto-fit-text

Usage

Angular

import { AutoFitTextModule } from "nativescript-auto-fit-text/angular"
 
@NgModule({
    ...
    imports[
        AutoFitTextModule
    ],
    ...
})
export class AppModule { }
 
<AutoFitText text="Testinggggggggggggggggg" textWrap="false"></AutoFitText>

Vanilla Nativescript

<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded" class="page" xmlns:ui="nativescript-auto-fit-text">
  <StackLayout class="p-20">
    <ui:AutoFitText text="Testinggggggggggggggggg" textWrap="false"></ui:AutoFitText>
  </StackLayout>
</Page>

Credits

@grantland - android-autofittextview

License

Apache License Version 2.0, January 2004

Package Sidebar

Install

npm i nativescript-auto-fit-label

Weekly Downloads

1

Version

1.0.4

License

Apache-2.0

Unpacked Size

38.7 kB

Total Files

40

Last publish

Collaborators

  • brandless