You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AbsoluteLayout container is the simplest layout container in NativeScript. It uses absolute top-left 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.
8
+
The `<AbsoluteLayout>` container is the simplest layout container in NativeScript.
8
9
9
-
### Samples
10
+
`<AbsoluteLayout>` has the following behavior:
10
11
11
-
#### A grid-like layout
12
+
* Uses a pair of absolute left/top coordinates to position its children.
13
+
* Doesn't enforce any layout constraints on its children.
14
+
* Doesn't resize its children at runtime when its size changes.
15
+
16
+
## Examples
17
+
18
+
### A grid-like layout
19
+
20
+
The following example creates a simple grid. For more information about creating grid layouts, see [GridLayout](/en/docs/elements/layouts/grid-layout).
12
21
13
22
```html
14
23
<AbsoluteLayoutbackgroundColor="#3c495e">
@@ -20,7 +29,9 @@ The AbsoluteLayout container is the simplest layout container in NativeScript. I
DockLayout is a layout that provides a docking mechanism for child elements to the `left`, `right`, `top`, `bottom`or center of the layout. To define the docking side of a child element, use its `dock` property. To dock a child element to the center of the DockLayout, it must be the **last child** of the DockLayout and the `stretchLastChild` property of the DockLayout must be set to `true`.
7
+
`<DockLayout>` is a layout container that lets you dock child elements to the sides or the center of the layout.
8
8
9
-
### Samples
9
+
`<DockLayout>` has the following behavior:
10
10
11
-
#### Dock to every side without stretching last child
11
+
* Uses the `dock` property to dock its children to the `left`, `right`, `top`, `bottom` or center of the layout.<br/>To dock a child element to the center, it must be the **last child** of the container and you must set the `stretchLastChild` property of the parent to `true`.
12
+
* Enforces layout constraints to its children.
13
+
* Resizes its children at runtime when its size changes.
14
+
15
+
## Examples
16
+
17
+
### Dock to every side without stretching the last child
18
+
19
+
The following example creates a frame-like layout consisting of 4 elements, position at the 4 edges of the screen.
#### Dock to every side with stretching last child
31
+
### Dock to every side and stretch the last child
32
+
33
+
The following example shows how `stretchLastChild` affects the positioning of child elements in a `DockLayout` container. The last child (`bottom`) is stretched to take up all the remaining space after positioning the first three elements.
0 commit comments