NativeScript Centered Label
This plugin allows you to have Label that are centered both vertically and horizontally
Demo apps
NativeScript-Core (XML)
Check out the demo folder. This is how to clone and run it:
git clone https://github.com/mhtghn/nativescript-centered-labelcd nativescript-centered-label/srcnpm run demo.ios # or demo.android
NativeScript-Angular
Check out the demo-angular folder. This is how to clone and run it:
git clone https://github.com/mhtghn/nativescript-centered-labelcd nativescript-centered-label/srcnpm run demo-angular.ios # or demo-angular.android
Installation
tns plugin add nativescript-centered-label
Usage
NativeScript-Core (XML)
<!-- Add your page content here -->
NativeScript Angular
TypeScript
...;
HTML
<ActionBar class="action-bar"> <Label class="action-bar-title" text="Home"></Label></ActionBar> <GridLayout class="page"> <CenteredLabel text="Centered Label" class="c-label" (tap)="testTap()"></CenteredLabel></GridLayout>
CSS
.c-label{ background-color: rgba(0, 0, 0, 0.1); border-width: 4; border-color: #a8a8a8; height: 20%; width: 60%; border-radius: 30; color: black; font-size: 20;}