mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
20 lines
550 B
TypeScript
20 lines
550 B
TypeScript
import pages = require("ui/page");
|
|
import button = require("ui/button");
|
|
import panelModule = require("ui/layouts/stack-layout");
|
|
|
|
export function createPage() {
|
|
|
|
// https://github.com/NativeScript/cross-platform-modules/issues/61
|
|
|
|
var stackPanel = new panelModule.StackLayout();
|
|
stackPanel.id = "stackPanel";
|
|
|
|
var btn = new button.Button();
|
|
btn.text = "getViewById";
|
|
|
|
var page = new pages.Page();
|
|
page.content = stackPanel;
|
|
page.getViewById<panelModule.StackLayout>("stackPanel").addChild(btn);
|
|
|
|
return page;
|
|
} |