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

Constructor

new RowLayout(options?)

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

Properties

alignment

Determines the vertical placement of the children. For the stretchY value to work correctly the composite needs to be given a width either by setting width or by setting top and bottom.

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