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
Copy file name to clipboardExpand all lines: content/ui/grid-layout.md
+72-19Lines changed: 72 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
---
2
2
title: GridLayout
3
+
description: A layout container that lets you arrange its child elements in a table-like manner.
4
+
contributors:
5
+
- rigor789
6
+
- Ombuweb
3
7
---
4
8
5
-
`<GridLayout>` is a layout container that lets you arrange its child elements in a table-like manner.
6
-
7
9
The grid consists of rows, columns, and cells. A cell can span one or more rows and one or more columns. It can contain multiple child elements which can span over multiple rows and columns, and even overlap each other.
8
10
9
11
By default, `<GridLayout>` has one column and one row. You can add columns and rows by configuring the `columns` and the `rows` properties. In these properties, you need to set the number of columns and rows and their width and height. You set the number of columns by listing their widths, separated by a comma. You set the number of rows by listing their heights, separated by a comma.
@@ -14,8 +16,6 @@ You can set a fixed size for column width and row height or you can create them
14
16
-**auto:** Makes the column as wide as its widest child or makes the row as tall as its tallest child.
15
17
-**\*:** Takes as much space as available after filling all auto and fixed size columns or rows.
16
18
17
-
See [References](#references) for more information.
18
-
19
19
### GridLayout with fixed sizing
20
20
21
21
The following example creates a simple 2-by-2 grid with fixed column widths and row heights.
@@ -79,23 +79,76 @@ The following example creates a complex grid with responsive design, mixed width
A string value representing column widths delimited with commas.
91
+
92
+
Valid values: an absolute number, `auto`, or `*`:
93
+
94
+
- A number indicates an absolute column width.
95
+
-`auto` makes the column as wide as its widest child.
96
+
-`*` makes the column occupy all available horizontal space. The space is proportionally divided over all star-sized columns. You can set values such as `3*` and `5*` to indicate a ratio of 3:5 in sizes.
97
+
98
+
### rows {#grid-rows}
99
+
100
+
```ts
101
+
rows: string// eg. *, 50, auto
102
+
```
103
+
104
+
A string value representing row heights delimited with commas.
105
+
106
+
Valid values: an absolute number, `auto`, or `*`:
107
+
108
+
- A number indicates an absolute row height.
109
+
-`auto` makes the row as tall as its tallest child.
110
+
-`*` makes the row occupy all available vertical space. The space is proportionally divided over all star-sized rows. You can set values such as `3*` and `5*` to indicate a ratio of 3:5 in sizes.
111
+
112
+
### ...Inherited
113
+
114
+
Additional inherited properties not shown. Refer to the [API Reference](/api/class/GridLayout).
|`columns`|`String`| A string value representing column widths delimited with commas.<br/>Valid values: an absolute number, `auto`, or `*`.<br/>A number indicates an absolute column width. `auto` makes the column as wide as its widest child. `*` makes the column occupy all available horizontal space. The space is proportionally divided over all star-sized columns. You can set values such as `3*` and `5*` to indicate a ratio of 3:5 in sizes. |
89
-
|`rows`|`String`| A string value representing row heights delimited with commas.<br/>Valid values: an absolute number, `auto`, or `*`.<br/>A number indicates an absolute row height. `auto` makes the row as tall as its tallest child. `*` makes the row occupy all available vertical space. The space is proportionally divided over all star-sized rows. You can set values such as `3*` and `5*` to indicate a ratio of 3:5 in sizes. |
90
-
|`...Inherited`|`Inherited`| Additional inherited properties not shown. Refer to the [API Reference](https://docs.nativescript.org/api-reference/classes/gridlayout)|
118
+
When an element is a direct child of `<GridLayout>`, these properties are accounted for:
91
119
92
-
### Children props
120
+
### row
93
121
94
-
When an element is a direct child of `<GridLayout>`, you can work with the following additional properties.
122
+
```ts
123
+
row: number
124
+
```
125
+
126
+
The row for the element.
127
+
128
+
The rows are 0-indexed, so the first row is indicated by `0`.
129
+
130
+
### col
131
+
132
+
```ts
133
+
col: number
134
+
```
135
+
136
+
The column for the element.
137
+
138
+
The columns are 0-indexed, so the first column is indicated by `0`.
139
+
140
+
### rowSpan
141
+
142
+
```ts
143
+
rowSpan: number
144
+
```
145
+
146
+
The number of rows for the element to span across.
|`row`|`Number`| Specifies the row for this element. Combined with a `col` property, specifies the cell coordinates of the element.<br/>The first row is indicated by `0`. |
99
-
|`col`|`Number`| Specifies the column for the element. Combined with a `row` property, specifies the cell coordinates of the element.<br/>The first column is indicated by `0`. |
100
-
|`rowSpan`|`Number`| Specifies the number of rows which this element spans across. |
101
-
|`colSpan`|`Number`| Specifies the number of columns which this element spans across. |
154
+
The number of columns for the element to span across.
Copy file name to clipboardExpand all lines: content/ui/index.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
title: UI Components
3
3
description: NativeScript ships with commonly used UI components, these are the foundational building blocks. Additional UI components can be created or installed via plugins.
Copy file name to clipboardExpand all lines: content/ui/stack-layout.md
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,12 @@
1
1
---
2
2
title: StackLayout
3
+
description: A layout container that arranges child views in a horizontal or vertical stack.
3
4
contributors:
4
5
- rigor789
5
6
- Ombuweb
6
7
- ammarahm-ed
7
8
---
8
9
9
-
`<StackLayout>` is a layout container that arranges child views in a horizontal or vertical stack.
10
-
11
10
When you add child views to a StackLayout, they will be arranged one after the other in the specified direction, either horizontally or vertically. By default, the orientation of a StackLayout is vertical, but you can change it to `horizontal` by setting the `orientation` property.
0 commit comments