Warning Unreleased Docs! - You may be viewing documentation that reflects an upcoming release and the functionality described may not be in the current version you are using. Change the version above to the most recent version.


The NativeToolbar method let you create and remove a toolbar at runtime.

Either Toolbar or Tabbar should be used in an application – Toolbar and Tabbar shouldnot be used simultaneously.

Enabling the API

This API is part of the coreapi extension that is included automatically.

extensions: ["coreapi"]

JavaScript Usage

Be sure to review the JavaScript API Usage guide for important information about using this API in JavaScript.

Ruby Usage

Be sure to review the Ruby API Usage guide for important information about using this API in Ruby.


create(ARRAY toolbarElements, HASH toolBarProperties)

Creates a new toolbar and removes the current toolbar and replaces it with this one. Any images used for UI elements should be specified by either an absolute path. i.e. ‘/sdcard/nmt/blabla.com.bla./data/public/img/button.png’


  • toolbarElements : ARRAY

    Array of Toolbar elements. Do not create more than five elements for maximum portability.Toolbar elements are not scrollable, so if some buttons will not fit into the screen dimensions, they will be invisible.

    • toolbarElement : HASH

      Properties of Toolbar elements. Either :icon or :label must be specified. If both are specified, :icon is drawn and :label is discarded.

      • label : STRING

        Visible label to display instead of an icon.For predefined actions, icon will be displayed. Android, iOS note: for predefined actions no label will be displayed.

      • action : STRING

        URL to call when button is pressed or special value.It may be path to Ruby controller action; i.e. ‘/app/Account’ would load the Account index action. For ruby callback use ‘callback:/app/Account’ Or javascript method to call: ‘javascript: methodOnButton();’.

        Possible Values :


        Add a separator to the toolbar. If only one separator is specified, then elements after separator will be right-aligned. If more then one separator is added: on WM/CE, platform dependent separator will be displayed, on Android/iOS center-aligned groups will be created.


        WM, CE, Win32, iOS, Android


        Exit the application.


        Exit the application.


        Navigate to Settings page, defined in configuration file.


        Navigate to Home page, defined in configuration file.


        Refresh current page.


        Perform back action or execute browser back.


        Display Log View window.


        WM, CE, Win32, iOS, Android


        Expand application window to full screen.


        WM, CE, Win32, Android, WP8


        Run full sync command.


        Minimize application window.


        WM, CE, Win32


        Display software keyboard window.Set Rho.System.keyboardState to Rho.System.KEYBOARD_AUTOMATIC to use this element.



      • icon : STRING

        Relative path to toolbar item icon in your rhodes app (typically located in ‘/public/images/’). Icon is ignored for predefined actions, icon will be displayed even if no icon specified. iPhone and Android: Icons must be no more than 30x30 pixels and must be in .png format. Windows Mobile: Icons can be any size, but all icons should have same size (default – 48x48). .png and .bmp formats are supported.

      • coloredIcon : BOOLEAN Default: false

        Use colored icon in toolbar on iPhone instead of standard monochrome white icon (prepared from image alpha).

      • width : INTEGER

        Button width in pixel. Used to define separator width when more than one separator specified.

  • toolBarProperties : HASH

    Properties of TabBar.

    • backgroundColor : INTEGER

      Background color of the toolbar.

    • maskColor : INTEGER Default: 0xFFFFFF

      Image mask color(transparent color).

      Platforms:WM, CE, Win32
    • viewHeight : INTEGER

      Toolbar height in pixels.

      Platforms:WM, CE, Win32

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.NativeToolbar.create(ARRAY toolbarElements, HASH toolBarProperties)
    • Ruby: Rho::NativeToolbar.create(ARRAY toolbarElements, HASH toolBarProperties)


Removes the current toolbar. Does nothing if there is no active toolbar.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.NativeToolbar.remove()
    • Ruby: Rho::NativeToolbar.remove()


Create native toolbar

Create a native Toolbar.

        label: "Home",
        action: Rho.Application.startURI
    }, {
        label: "example.com",
        action: "http://www.example.org"
    }], {})
  :label => "Home",
  :action => url_for(Rho::Application.startURI)
  :label => "example.com",
  :action => "http://www.example.com",
], {})
Remove the toolbar

Remove the toolbar.