Class “StackComposite”

Object > NativeObject > Widget > Composite > StackComposite

A composite with the layout property initialized with a StackComposite. All children are automatically arranged in one vertical stack, starting from the top. The layoutData on the children is currently ignored.

StackComposite on Android
Android
StackComposite on iOS
iOS
Constructor public
Singleton No
Namespace tabris
Direct subclasses None
JSX support Element: <StackComposite/>
Parent element: <Composite/> and any widget extending Composite
Child elements: Widgets
Text content: Not supported

Example

import {StackComposite, contentView} from 'tabris';

const stackComposite = new StackComposite({
  layoutData: 'fill',
  spacing: 16
}).appendTo(contentView);

stackComposite.append(
   new TextView({text: 'top'}),
   new TextView({text: 'center'}),
   new TextView({text: 'bottom'})
);

Constructor

new StackComposite(properties?)

Parameter Type Optional Description
properties Properties<StackComposite> Yes Sets all key-value pairs in the properties object as widget properties.

Properties

alignment

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

Type 'left' | 'centerX' | 'stretchX' | 'right'
Default 'left'
Settable On creation

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

layout

The stack layout manager responsible for interpreting the layoutData of the child widgets of this Composite.

Type StackLayout
Default StackLayout
Settable On creation

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

spacing

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

Type number
Default 16
Settable On creation

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