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

1.0.3 • Public • Published

@nativescript/auto-fit-text

ns plugin add @nativescript/auto-fit-text

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

Usage

Nativescript

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

Angular NativeScript

import { NativeScriptAutoFitTextModule } from '@nativescript/auto-fit-text/angular';

// Be sure to add the plugin module to your NgModule
@NgModule({
	imports: [NativeScriptAutoFitTextModule],
})
<AutoFitText row="2" fontSize="48" text="Lorem Ipsum this line of text with fontSize ignored because the text is so long." textWrap="false"></AutoFitText>

Credits

@grantland - android-autofittextview

License

Apache License Version 2.0, January 2004

Package Sidebar

Install

npm i @nativescript/auto-fit-text

Weekly Downloads

92

Version

1.0.3

License

Apache-2.0

Unpacked Size

13.9 kB

Total Files

19

Last publish

Collaborators

  • nativescript-user
  • tns-bot
  • lini
  • tachev
  • rosen-vladimirov
  • stoskov
  • rosen_vladimirov
  • walkerrunpdx
  • bradmartin
  • davecoffin
  • rigor789
  • nativescript-bot
  • multishiv19
  • eddyverbruggen
  • edusperoni
  • facetious
  • tdermendjiev
  • sis0k0