forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpageNavigation.ts
More file actions
27 lines (24 loc) · 737 Bytes
/
pageNavigation.ts
File metadata and controls
27 lines (24 loc) · 737 Bytes
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
import frame = require("ui/frame");
import pages = require("ui/page");
import buttonModule = require("ui/button");
import tabViewModule = require("ui/tab-view");
export function createPage() {
var tab = new tabViewModule.TabView();
tab.items = [];
for (var i = 0; i < 10; i++) {
var button = new buttonModule.Button();
button.text = "Test";
button.on(buttonModule.Button.tapEvent, function () {
var topFrame = frame.topmost();
topFrame.goBack();
});
tab.items.push({
title: "Tab " + i,
view: button
});
}
var page = new pages.Page();
page.content = tab;
return page;
}
//export var Page = new pages.Page();