mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00
34 lines
1023 B
TypeScript
34 lines
1023 B
TypeScript
import * as pages from "tns-core-modules/ui/page";
|
|
import * as frame from "tns-core-modules/ui/frame";
|
|
import * as stackModule from "tns-core-modules/ui/layouts/stack-layout";
|
|
import * as button from "tns-core-modules/ui/button";
|
|
import * as text from "tns-core-modules/ui/text-field";
|
|
|
|
export function createPage() {
|
|
var page = new pages.Page();
|
|
var stack = new stackModule.StackLayout();
|
|
|
|
var btn = new button.Button();
|
|
btn.text = "Page C new activity";
|
|
btn.on(button.Button.tapEvent, function () {
|
|
var nextPage = "tests/pages/navigation/pageC-new-activity";
|
|
frame.topmost().navigate(nextPage);
|
|
});
|
|
stack.addChild(btn);
|
|
|
|
var backBtn = new button.Button();
|
|
backBtn.text = "BACK";
|
|
backBtn.on(button.Button.tapEvent, function () {
|
|
frame.topmost().goBack();
|
|
});
|
|
stack.addChild(backBtn);
|
|
|
|
var txt = new text.TextField();
|
|
txt.text = "text new B";
|
|
stack.addChild(txt);
|
|
|
|
page.content = stack;
|
|
return page;
|
|
}
|
|
//export var Page = page;
|