

Rows: Two stars plus three stars is equal to five stars.So first column is 1 x 100 = 100 pixels wide and second column is 2 x 100 = 200 pixels wide. Divide GridLayout width (300) by 3 to get 100. Columns: One star plus two stars is equal to three stars.

Gets or sets a value that indicates the total number of columns that child content spans within a GridLayout. Gets or sets a value that indicates the total number of rows that child content spans within a GridLayout. Gets or sets a value that indicates which column child content within a GridLayout it should appear in. Gets or sets a value that indicates which row child content within a GridLayout it should appear in. A number indicates an absolute row height, auto makes the row as high as its highest child, and * makes the row occupy all available vertical space. Row heights can be either an absolute number, auto or *. A number indicates an absolute column width, auto makes the column as wide as its widest child, and * makes the column occupy all available horizontal space.Ī string value representing row heights delimited with commas. Column widths can be either an absolute number, auto or *. Auto: Takes as much space as needed by the contained child element(s).Ī string value representing column widths delimited with commas.Star (*): Takes as much space as available (after filling all auto and fixed sized columns), proportionally divided over all star-sized columns.The width of a column and the height of a row can be specified as an absolute amount of pixels, as a percentage of the available space or automatically: To add additional columns and rows, you have to specify column definition items (separated by commas) to the columns property and row definition items (separated by commas) to the rows property of the GridLayout. The GridLayout has one column and one row by default. A cell can contain multiple child elements, they can span over multiple rows and columns, and even overlap each other. The GridLayout is a layout that arranges its child elements in a table structure of rows and columns. Possible values are left, top, right and bottom.Įxample for multiple child elements on one side Specifies the Dock position of a child element that is inside a DockLayout. Gets or sets a value that indicates whether the last child element within a DockLayout stretches to fill the remaining available space. 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.

To define the docking side of a child element, use its dock property. The DockLayout is a layout that provides a docking mechanism for child elements to the left, right, top, bottom or center of the layout. Gets or sets the distance, in pixels, between the top edge of the child and the top edge of its parent AbsoluteLayout client area. Gets or sets the distance, in pixels, between the left edge of the child and the left edge of its parent AbsoluteLayout client area. The AbsoluteLayout will not enforce any layout constraints on its children and will not resize them at runtime when its size changes. It uses absolute left-top coordinates to position its children. The AbsoluteLayout is the simplest layout in NativeScript. Looking for a fun and easy way to learn about NativeScript layout containers? Try the interactive tutorials available at ! AbsoluteLayout
