Developer   API   Native User Interface   StackLayout

StackLayout(native)

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

Properties

  • align : Symbol
    Sets vertical alignment of elements. For supported symbols see StackLayout's align symbols.
  • orientation : Symbol
    Manages positions of embedded elements. For supported symbols see StackLayout's orientation symbols.
  • pack : Symbol
    Manages horizontal positions of embedded elements. See StackLayout's pack symbols.
  • spacer : Integer
    Determines gaps between elements.

Methods

  • setMargin(left, top, right, bottom) : StackLayout
    Sets the margin around inserted elements.
  • this() : StackLayout
    Constucts new StackLayout object.