Class “StackLayout”

Object > Layout > StackLayout

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

All children of the composite are automatically arranged in one vertical stack, starting from the top. The layoutData on the children is currently ignored.

Constructor public
Singleton No
Namespace tabris
Direct subclasses None
JSX support No

Example

import {Composite, StackLayout} from 'tabris';

new Composite({layout: new StackLayout({spacing: 16, alignment: 'left'})});

See also:

JS Creating a simple Stack with an included StackLayout

Constructor

new StackLayout(parameterObject?)

Parameter Type Optional Description
parameterObject {spacing?: number, alignment?: 'left' | 'centerX' | 'stretchX' | 'right'} Yes Sets the alignment and spacing properties.

Properties

alignment

Determines the horizontal placement of the children. For the stretchX value to work correctly the composite needs to be given a width either by setting width or by setting left and right.

Type 'left' | 'centerX' | 'stretchX' | 'right'
Default 'left'
Settable No
Change events No

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

spacing

Additional space to add between the children in device independent pixel.

Type number
Settable No
Change events No

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

Static Properties

default

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

Type StackLayout
Settable Yes
Change events No