StackLayout

StackLayout places components on top of a base component.

For the complete API reference, see https://doc.jdance.org.

Overview

A label positioned over a small colored surface.

CODE
BasicLayout background = new BasicLayout(BasicLayout.Direction.VERTICAL);
background.setRelativeWidth(100);
background.setHeight(100);
background.setBackground(new Color("#DCEEFF"));
StackLayout layout = new StackLayout();
layout.setRelativeWidth(100);
layout.setHeight(100);
layout.setContent(background);
layout.add(new Text("Overlay")).setHAlign(Align.CENTER).setVAlign(Align.CENTER);
RESULT
Overlay