diff --git a/content/docs/en/elements/layouts/absolute-layout.md b/content/docs/en/elements/layouts/absolute-layout.md index 941998f2..237a1f9d 100644 --- a/content/docs/en/elements/layouts/absolute-layout.md +++ b/content/docs/en/elements/layouts/absolute-layout.md @@ -1,14 +1,22 @@ --- title: AbsoluteLayout apiRef: https://docs.nativescript.org/api-reference/modules/_ui_layouts_absolute_layout_ -contributors: [rigor789] +contributors: [rigor789, ikoevska] --- -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. +The `` container is the simplest layout container in NativeScript. -### Samples +`` has the following behavior: -#### A grid-like layout +* Uses a pair of absolute left/top coordinates to position its children. +* Doesn't enforce any layout constraints on its children. +* Doesn't resize its children at runtime when its size changes. + +## Examples + +### A grid-like layout + +The following example creates a simple grid. For more information about creating grid layouts, see [GridLayout](/en/docs/elements/layouts/grid-layout). ```html @@ -20,7 +28,9 @@ The AbsoluteLayout container is the simplest layout container in NativeScript. I ``` -#### Overlapping elements +### Overlapping elements + +The following example creates a group of overlapping items. ```html @@ -30,17 +40,15 @@ The AbsoluteLayout container is the simplest layout container in NativeScript. I ``` - ## Props -AbsoluteLayout has no props. +None. -## Additional Children Props +## Additional children props -When an element is a direct child of the AbsoluteLayout, the following -props get a meaning: +When an element is a direct child of ``, you can work with the following additional properties. -| name | type | description | +| Name | Type | Description | |------|------|-------------| -| `top` | `Number` | A value representing the distance from the top of the parent AbsoluteLayout -| `left` | `Number` | A value representing the distance from the left of the parent AbsoluteLayout +| `top` | `Number` | Gets or sets the distance, in pixels, between the top edge of the child and the top edge of its parent. +| `left` | `Number` | Gets or sets the distance, in pixels, between the left edge of the child and the left edge of its parent. diff --git a/content/docs/en/elements/layouts/dock-layout.md b/content/docs/en/elements/layouts/dock-layout.md index 07f6c943..178b2fc5 100644 --- a/content/docs/en/elements/layouts/dock-layout.md +++ b/content/docs/en/elements/layouts/dock-layout.md @@ -1,14 +1,22 @@ --- title: DockLayout apiRef: https://docs.nativescript.org/api-reference/modules/_ui_layouts_dock_layout_ -contributors: [rigor789] +contributors: [rigor789, ikoevska] --- -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`. +`` is a layout container that lets you dock child elements to the sides or the center of the layoyt. -### Samples +`` has the following behavior: -#### Dock to every side without stretching last child +* Uses the `dock` property to dock its children to the `left`, `right`, `top`, `bottom` or center of the layout.
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`. +* Enforces layout constraints to its children. +* Resizes its children at runtime when its size changes. + +## Examples + +### Dock to every side without stretching the last child + +The following example creates a frame-like layout consisting of 4 elements, position at the 4 edges of the screen. ```html @@ -20,7 +28,9 @@ DockLayout is a layout that provides a docking mechanism for child elements to t ``` -#### Dock to every side with stretching last child +### Dock to every side and stretch the last child + +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. ```html @@ -32,8 +42,25 @@ DockLayout is a layout that provides a docking mechanism for child elements to t ``` -#### Multiple children on the same side +### Dock to every side and the center + +The following example creates a `` of 5 elements. The first four wrap the center element in a frame. + +```html + + +``` + + +### Dock multiple children to the same side +The following example creates a single line of 4 elements that stretch across the entire height and width of the screen. + ```html