mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
21 lines
445 B
TypeScript
21 lines
445 B
TypeScript
import { EventData, Page } from "tns-core-modules/ui/page";
|
|
import { View } from "tns-core-modules/ui/core/view";
|
|
|
|
let view: View;
|
|
|
|
export function pageLoaded(args: EventData) {
|
|
const page = <Page>args.object;
|
|
view = page.getViewById<View>("view");
|
|
}
|
|
|
|
export function onAnimate(args: EventData) {
|
|
view.animate({
|
|
rotate: 360,
|
|
duration: 3000
|
|
});
|
|
}
|
|
|
|
export function onReset(args: EventData) {
|
|
view.rotate = 0;
|
|
}
|