MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / createPage

Function createPage

apps/automated/src/pages/page15.ts:5–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import * as stackModule from '@nativescript/core/ui/layouts/stack-layout';
4
5export function createPage() {
6 var page = new pageModule.Page();
7 var stackLayout = new stackModule.StackLayout();
8 var btn1 = new buttonModule.Button();
9 btn1.horizontalAlignment = 'left';
10 btn1.verticalAlignment = 'top';
11 btn1.marginTop = 10;
12 btn1.marginRight = 0;
13 btn1.marginBottom = 10;
14 btn1.marginLeft = 20;
15 btn1.text = 'top, left';
16
17 var btn2 = new buttonModule.Button();
18 btn2.horizontalAlignment = 'center';
19 btn2.verticalAlignment = 'middle';
20 btn2.text = 'center, center';
21
22 var btn3 = new buttonModule.Button();
23 btn3.horizontalAlignment = 'right';
24 btn3.verticalAlignment = 'bottom';
25 btn3.text = 'bottom, right';
26
27 var btn4 = new buttonModule.Button();
28 btn4.horizontalAlignment = 'stretch';
29 btn4.verticalAlignment = 'stretch';
30 btn4.text = 'stretch, stretch';
31
32 stackLayout.addChild(btn1);
33 stackLayout.addChild(btn2);
34 stackLayout.addChild(btn3);
35 stackLayout.addChild(btn4);
36
37 page.content = stackLayout;
38
39 return page;
40}

Callers

nothing calls this directly

Calls 1

addChildMethod · 0.45

Tested by

no test coverage detected