Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Commit 617eb06

Browse files
committed
Added second AbsoluteLayout example.
1 parent cf38d74 commit 617eb06

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
2.53 KB
Loading

ui/layout-containers.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ previous_url: /layout-containers
1414
* [WrapLayout](#wraplayout)
1515

1616
## [AbsoluteLayout]("http://docs.nativescript.org/ApiReference/ui/layouts/absolute-layout/HOW-TO.md")
17+
The AbsoluteLayout us the simplest layout in NativeScript. It uses absolute left-top coordinates to position its children. The AbsoluteLayout will not enforce any layout constraints on its children and will not resize them at runtime when its size changes.
1718

1819
### AbsoluteLayout Properties
1920
None.
@@ -38,6 +39,18 @@ None.
3839

3940
![AbsoluteLayout](http://docs.nativescript.org/img/modules/layouts/absolute-layout.png "AbsoluteLayout")
4041

42+
### Sample (margin)
43+
```XML
44+
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
45+
<AbsoluteLayout width="210" height="210" style.backgroundColor="lightgray">
46+
<Label text="no margin" left="10" top="10" width="100" height="100" backgroundColor="red"/>
47+
<Label text="margin=`30`" left="10" top="10" margin="30" width="100" height="90" backgroundColor="green"/>
48+
</AbsoluteLayout>
49+
</Page>
50+
```
51+
52+
![AbsoluteLayout](http://docs.nativescript.org/img/modules/layouts/absolute-layout2.png "AbsoluteLayout")
53+
4154
## [DockLayout]("http://docs.nativescript.org/ApiReference/ui/layouts/dock-layout/HOW-TO.md")
4255

4356
### DockLayout Properties

0 commit comments

Comments
 (0)