Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt

Demonstrates adding a Toolbar control to an iOS or Android application.

Info
titleExample App Source Location

You can find this example app in the Alloy repository under samples/apps/ui/toolbar. Check the instructions how to run these sample projects.

A Toolbar can contain Button controls and certain other controls, such as TextFields and Labels. iOS notes: To provide spacing between items in the toolbar, you can insert a <FlexSpace/> element to fill the space between items (as seen in the example) or a <FixedSpace/> element whose width attribute specifies the spacer width to add.

iOSAndroid

Example

Code Block
titleapp/views/index.xml
linenumberstrue
languagexml
<Alloy>
  <Window>
    <Toolbar>
      <!-- These get added to the Toolbar "items" array -->
      <Items>
        <Button>Action 1</Button>
        <FlexSpace platform="ios" />
        <Button>Action 2</Button>
      </Items>
    </Toolbar>
  </Window>
</Alloy>

See also