-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
page15.ts
40 lines (33 loc) · 1.2 KB
/
page15.ts
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
28
29
30
31
32
33
34
35
36
37
38
39
40
import * as pageModule from "@nativescript/core/ui/page";
import * as buttonModule from "@nativescript/core/ui/button";
import * as stackModule from "@nativescript/core/ui/layouts/stack-layout";
export function createPage() {
var page = new pageModule.Page();
var stackLayout = new stackModule.StackLayout();
var btn1 = new buttonModule.Button();
btn1.horizontalAlignment = "left";
btn1.verticalAlignment = "top";
btn1.marginTop = 10;
btn1.marginRight = 0;
btn1.marginBottom = 10;
btn1.marginLeft = 20;
btn1.text = "top, left";
var btn2 = new buttonModule.Button();
btn2.horizontalAlignment = "center";
btn2.verticalAlignment = "middle";
btn2.text = "center, center";
var btn3 = new buttonModule.Button();
btn3.horizontalAlignment = "right";
btn3.verticalAlignment = "bottom";
btn3.text = "bottom, right";
var btn4 = new buttonModule.Button();
btn4.horizontalAlignment = "stretch";
btn4.verticalAlignment = "stretch";
btn4.text = "stretch, stretch";
stackLayout.addChild(btn1);
stackLayout.addChild(btn2);
stackLayout.addChild(btn3);
stackLayout.addChild(btn4);
page.content = stackLayout;
return page;
}