Nathan Walker
2023-10-09 12:00:21 -07:00
committed by GitHub
parent 93e24783a1
commit d6478237ec
18 changed files with 230 additions and 76 deletions

View File

@ -1,4 +1,4 @@
import { Page, Observable, EventData } from '@nativescript/core';
import { Page, Observable, EventData, Label, Color } from '@nativescript/core';
let page: Page;
@ -7,4 +7,23 @@ export function navigatingTo(args: EventData) {
page.bindingContext = new SampleData();
}
export class SampleData extends Observable {}
export class SampleData extends Observable {
strokeLabel: Label;
loadedStrokeLabel(args) {
this.strokeLabel = args.object;
}
toggleStrokeStyle() {
if (this.strokeLabel.style.textStroke) {
this.strokeLabel.style.color = new Color('black');
this.strokeLabel.style.textStroke = null;
} else {
this.strokeLabel.style.color = new Color('white');
this.strokeLabel.style.textStroke = {
color: new Color('black'),
width: { value: 2, unit: 'px' },
};
}
}
}

View File

@ -25,6 +25,9 @@
<GridLayout marginTop="10" borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
<Button text="Test Button text-overflow: initial, this should be long sentence and truncated in the middle with ellipsis." textOverflow="initial" whiteSpace="nowrap" />
</GridLayout>
<GridLayout marginTop="10" height="60" paddingLeft="5" tap="{{toggleStrokeStyle}}">
<Label text=" text-stroke" style="text-stroke: 2px black; color: #fff; font-size: 35; font-weight: bold; font-family:Arial, Helvetica, sans-serif" loaded="{{loadedStrokeLabel}}"/>
</GridLayout>
<Label text="maxLines 2" fontWeight="bold" marginTop="10" />
<Label
text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."