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

Function createPage

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

Source from the content-addressed store, hash-verified

3import * as layout from '@nativescript/core/ui/layouts/stack-layout';
4
5export function createPage() {
6 var page = new pages.Page();
7 var linearLayout = new layout.StackLayout();
8
9 var btn = addButton(linearLayout, 'left');
10 btn.marginLeft = 100;
11 btn = addButton(linearLayout, 'center');
12 btn.marginTop = 100;
13 btn = addButton(linearLayout, 'right');
14 btn.marginRight = 100;
15
16 btn = addButton(linearLayout, 'stretch');
17 btn.marginLeft = 100;
18 btn.marginRight = 100;
19 btn.marginTop = 100;
20 btn.marginBottom = 100;
21
22 page.content = linearLayout;
23
24 return page;
25}
26
27function addButton(layout: layout.StackLayout, text: 'left' | 'center' | 'right' | 'stretch') {
28 var btn = new btns.Button();

Callers

nothing calls this directly

Calls 1

addButtonFunction · 0.85

Tested by

no test coverage detected