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.
Type: | StackLayout extends Layout |
Constructor: | public |
Singleton: | No |
Namespace: | tabris |
Direct subclasses: | None |
JSX Support: | No |
Examples
JavaScript
import {Composite, StackLayout, contentView} from 'tabris';
contentView.append(
new Composite({layout: new StackLayout({spacing: 16, alignment: 'left'})})
);
See also:
JSX Creating a simple Stack
with an included StackLayout
[► Run in Playground]
Constructor
new StackLayout(options?)
Parameter | Type | Description |
---|---|---|
options | { |
Sets the alignment and spacing properties. Optional. |
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' |
Default: | 'left' |
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 StackLayout used as the default layout
property value of Stack
widgets. Equivalent to new StackLayout()
Type: | StackLayout |
Settable: | Yes |