Moscrif API Docs for: 2012q3
Show:

Moscrif.StackLayout Class

Library: ui

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);

Item Index

Methods

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

(
  • left
  • top
  • right
  • bottom
)
chainable

Sets the margin around inserted elements.

Parameters:

  • left Symbol

    Left margin.

  • top Symbol

    Top margin.

  • right Symbol

    Right margin.

  • bottom Symbol

    Bottom 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

spacer

Integer

Determines gaps between elements.