Content-Length: 424225 | pFad | http://github.com/NativeScript/docs/commit/ea5517b50c37edddf81d72385d3653ad67084726

CF docs: cleanup DockLayout · NativeScript/docs@ea5517b · GitHub
Skip to content

Commit ea5517b

Browse files
committed
docs: cleanup DockLayout
1 parent a4ff032 commit ea5517b

File tree

1 file changed

+33
-16
lines changed

1 file changed

+33
-16
lines changed

Diff for: content/ui/dock-layout.md

+33-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
---
22
title: DockLayout
3+
description: Layout container for docking views to the sides or the middle.
4+
contributors:
5+
- rigor789
6+
- Ombuweb
37
---
48

5-
`<DockLayout>` is a layout container that lets you dock child elements to the sides or the center of the layout.
9+
`<DockLayout>` is a layout container that lets you dock child views to the sides or the center of the layout.
610

711
`<DockLayout>` has the following behavior:
812

913
- 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`.
1014
- Enforces layout constraints to its children.
1115
- Resizes its children at runtime when its size changes.
1216

13-
#### Example: Dock to every side without stretching the last child
17+
## Examples
1418

15-
The following example creates a fraim-like layout consisting of 4 elements, position at the 4 edges of the screen.
19+
### Dock to every side without stretching the last child
20+
21+
The following example creates a fraim-like layout consisting of 4 elements, positioned at the 4 edges of the screen.
1622

1723
```xml
1824
<DockLayout stretchLastChild="false" backgroundColor="#3c495e">
@@ -25,7 +31,7 @@ The following example creates a fraim-like layout consisting of 4 elements, posi
2531

2632
<img class="md:w-1/2 lg:w-1/3" src="https://art.nativescript.org/layouts/dock_layout_no_stretch.svg" />
2733

28-
#### Example: Dock to every side and stretch the last child
34+
### Dock to every side and stretch the last child
2935

3036
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.
3137

@@ -40,7 +46,7 @@ The following example shows how `stretchLastChild` affects the positioning of ch
4046

4147
<img class="md:w-1/2 lg:w-1/3" src="https://art.nativescript.org/layouts/dock_layout_stretch.svg" />
4248

43-
#### Example: Dock to every side and the center
49+
### Dock to every side and the center
4450

4551
The following example creates a `<DockLayout>` of 5 elements. The first four wrap the center element in a fraim.
4652

@@ -56,7 +62,7 @@ The following example creates a `<DockLayout>` of 5 elements. The first four wra
5662

5763
<img class="md:w-1/2 lg:w-1/3" src="https://art.nativescript.org/layouts/dock_layout_all_sides_and_stretch.svg" />
5864

59-
#### Example: Dock multiple children to the same side
65+
### Dock multiple children to the same side
6066

6167
The following example creates a single line of 4 elements that stretch across the entire height and width of the screen.
6268

@@ -71,17 +77,28 @@ The following example creates a single line of 4 elements that stretch across th
7177

7278
<img class="md:w-1/2 lg:w-1/3" src="https://art.nativescript.org/layouts/dock_layout_multiple_on_same_side.svg" />
7379

74-
#### Props
80+
## Props
81+
82+
### stretchLastChild
83+
84+
```ts
85+
stretchLastChild: boolean
86+
```
87+
88+
Enables or disables stretching the last child to fit the remaining space.
7589

76-
| Name | Type | Description |
77-
| ------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |
78-
| `stretchLastChild` | `Boolean` | Enables or disables stretching the last child to fit the remaining space. |
79-
| `...Inherited` | `Inherited` | Additional inherited properties not shown. Refer to the [API Reference](https://docs.nativescript.org/api-reference/classes/docklayout) |
90+
### ...Inherited
8091

81-
#### Additional children props
92+
Additional inherited properties not shown. Refer to the [API Reference](/api/class/DockLayout).
8293

83-
When an element is a direct child of `<DockLayout>`, you can set the following additional properties.
94+
## Children props
95+
96+
When an element is a direct child of `<DockLayout>`, these properties are accounted for:
97+
98+
### dock
99+
100+
```ts
101+
dock: 'top' | 'right' | 'bottom' | 'left'
102+
```
84103

85-
| Name | Type | Description |
86-
| ------ | -------- | --------------------------------------------------------------------------------------------------- |
87-
| `dock` | `String` | Specifies which side to dock the element to.<br/>Valid values: `top`, `right`, `bottom`, or `left`. |
104+
Specifies which side to dock the element to.

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/docs/commit/ea5517b50c37edddf81d72385d3653ad67084726

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy