Class “RowLayout”

Object > Layout > RowLayout

Row based layout manager. Can be set on the layout property of any Composite or widget extending Composite like Page or Tab widget. The Row uses it as the default layout.

All children of the composite are automatically arranged in one horizontal row, starting from the left.

Type: RowLayout extends Layout
Constructor: public
Singleton: No
Namespace: tabris
Direct subclasses: None
JSX Support: No

Examples

JavaScript

import {Composite, RowLayout, contentView} from 'tabris';

contentView.append(
  new Composite({layout: new RowLayout({spacing: 16, alignment: 'top'})})
);

See also:

JSX Creating a simple Row with an included RowLayout [► Run in Playground]

Constructor

new RowLayout(options?)

Parameter Type Description
options {
  spacing: number, // optional
  alignment: // optional
    'top'
    | 'centerY'
    | 'stretchY'
    | 'bottom'
    | 'baseline'
}
Sets the alignment and spacing properties. Optional.

Properties

alignment

Determines the vertical placement of the children.

For stretchY to work correctly the Row needs to be given a height either by setting height or by setting top and bottom.

If baseline is set the first widget in the row will determine where that baseline is. By setting top, bottom or centerY on that widget the baseline can be shifted.

Type: 'top'
| 'centerY'
| 'stretchY'
| 'bottom'
| 'baseline'
Default: 'top'
Settable: No

This property can only be set via constructor. Once set, it cannot change anymore.

spacing

The Space between the children in device independent pixel.

Type: number
Default: 0
Settable: No

This property can only be set via constructor. Once set, it cannot change anymore.

Static Properties

default

Instance of RowLayout used as the default layout property value of Row widgets. Equivalent to new RowLayout()

Type: RowLayout
Settable: Yes