Moscrif.StackLayout Class
This class arranges components in a vertical (or horizontal) strip aligning them at right, left or centered, and/or filling them to take up any extra vertical or horizontal space.
Example:
var layout = new Moscrif.StackLayout();
layout.orientation = #vert;
layout.pack = #start;
layout.align = #stretch
layout.spacer = SPACE_WIDTH;
container = new Moscrif.View("container");
container.layout = layout;
…
var itemA = new Moscrif.View("itemA");
itemA.stretch = #both;
container.add(itemA);
var itemB = new Moscrif.View("itemB");
itemB.stretch = #both;
container.add(itemB);
Methods
this
()
Constucts new StackLayout object.
Example:
var layout = new Moscrif.StackLayout();
layout.setMargin(10, 50, 10, 50);
layout.align = #stretch
container = new Moscrif.View("container");
container.layout = layout;
app.add(container);
var item = new Moscrif.View("item");
item.stretch = #both;
container.add(item);
setMargin
(
chainable
left
top
right
bottom
Sets the margin around inserted elements.
Parameters:
-
left
SymbolLeft margin.
-
top
SymbolTop margin.
-
right
SymbolRight margin.
-
bottom
SymbolBottom margin.
Example:
var layout = new Moscrif.StackLayout();
layout.setMargin(10, 50, 10, 50);
layout.orientation = #vert;
layout.pack = #start;
layout.align = #stretch
container = new Moscrif.View("container");
container.layout = layout;
app.add(container);
var item = new Moscrif.View("item");
item.stretch = #both;
container.add(item);
Properties
align
Symbol
Sets vertical alignment of elements. For supported symbols see StackLayout's align symbols.
- #start
- #center
- #end
- #stretch
orientation
Symbol
Manages positions of embedded elements. For supported symbols see StackLayout's orientation symbols.
- #horz
- #vert
pack
Symbol
Manages horizontal positions of embedded elements. See StackLayout's pack symbols.
- #start
- #center
- #end