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

Function createPage

apps/automated/src/pages/page9.ts:6–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { Image } from '@nativescript/core/ui/image';
5
6export function createPage() {
7 var grid = new GridLayout();
8
9 grid.addColumn(new ItemSpec(1, 'auto'));
10 grid.addColumn(new ItemSpec(1, 'star'));
11
12 grid.addRow(new ItemSpec(1, 'auto'));
13 grid.addRow(new ItemSpec(1, 'star'));
14
15 var image = new Image();
16 image.stretch = 'fill';
17 image.verticalAlignment = 'bottom';
18 image.horizontalAlignment = 'center';
19
20 image.imageSource = ImageSource.fromFileSync(__dirname + '/test.png');
21 grid.addChild(image);
22
23 var page = new Page();
24 page.content = grid;
25 page.css = 'GridLayout { background-color: pink } image { background-color: green }';
26
27 return page;
28}

Callers

nothing calls this directly

Calls 4

addColumnMethod · 0.95
addRowMethod · 0.95
fromFileSyncMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected