-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
page16.ts
56 lines (45 loc) · 1.64 KB
/
page16.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import * as pageModule from "@nativescript/core/ui/page";
import * as buttonModule from "@nativescript/core/ui/button";
import * as stackModule from "@nativescript/core/ui/layouts/stack-layout";
import { Frame } from "@nativescript/core/ui/frame";
export function createPage() {
var page = new pageModule.Page();
//var iconItem = new pageModule.MenuItem();
//iconItem.text = "TEST";
//iconItem.icon = "~/app" + "/tests" + "/test-icon.png"; // use + to stop regex replace during build
//iconItem.on("tap", () => {
// console.log("Icon item tapped");
//});
//page.optionsMenu.addItem(iconItem);
//var textItem = new pageModule.MenuItem();
//textItem.text = "SAVE";
//textItem.on("tap", () => {
// console.log("Save item tapped");
//});
//page.optionsMenu.addItem(textItem);
var stackLayout = new stackModule.StackLayout();
//var count = 0;
var btn1 = new buttonModule.Button();
btn1.text = "add item";
//btn1.on("tap", () => {
// console.log("adding menu item");
// var newItem = new pageModule.MenuItem();
// var text = "item " + count;
// newItem.text = text
// newItem.on("tap", () => {
// console.log("ITEM [" + text + "] tapped");
// });
// page.optionsMenu.addItem(newItem);
// count++;
//});
stackLayout.addChild(btn1);
var btn2 = new buttonModule.Button();
btn2.text = "navigate";
btn2.on("tap", () => {
var nextPage = "app/tests/pages/page16";
Frame.topmost().navigate(nextPage);
});
stackLayout.addChild(btn2);
page.content = stackLayout;
return page;
}