mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
test: clickable-span test page
This commit is contained in:
9
apps/app/ui-tests-app/css/clickable-span.ts
Normal file
9
apps/app/ui-tests-app/css/clickable-span.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { EventData, TextBase } from "tns-core-modules/ui/text-base";
|
||||
|
||||
export function foxTap(args: EventData) {
|
||||
console.log("foxTap");
|
||||
}
|
||||
|
||||
export function dogTap(args: EventData) {
|
||||
console.log("dogTap");
|
||||
}
|
||||
17
apps/app/ui-tests-app/css/clickable-span.xml
Normal file
17
apps/app/ui-tests-app/css/clickable-span.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<Page>
|
||||
<StackLayout>
|
||||
<Label automationText="formattedText" id="formattedText" textWrap="true" style="text-transform: capitalize;">
|
||||
<Label.formattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.spans>
|
||||
<Span text="The quick brown " style="font-weight: bold; color: green;" />
|
||||
<Span text="fox" style="font-weight: italic; color: green;" linkClick="foxTap"/>
|
||||
<Span text=" jumps over the lazy " style="font-weight: bold; color: red;" />
|
||||
<Span text="dog" style="font-weight: bold; color: blue;" linkClick="dogTap"/>
|
||||
<Span text="." style="font-weight: bold; color: green;" />
|
||||
</FormattedString.spans>
|
||||
</FormattedString>
|
||||
</Label.formattedText>
|
||||
</Label>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
@@ -44,5 +44,6 @@ export function loadExamples() {
|
||||
examples.set("background-shorthand", "css/background-shorthand");
|
||||
examples.set("background-image-linear-gradient", "css/background-image-linear-gradient");
|
||||
examples.set("background-image", "css/background-image");
|
||||
examples.set("clickable-span", "css/clickable-span");
|
||||
return examples;
|
||||
}
|
||||
Reference in New Issue
Block a user