The NativeToolbar method let you create and remove a toolbar at runtime.
Only a Toolbar or a Tabbar can present in application – both can not be used at the same time.
This API is part of the coreapi
extension that is included automatically.
extensions: ["coreapi"]
Be sure to review the JavaScript API Usage guide for important information about using this API in JavaScript.
Be sure to review the Ruby API Usage guide for important information about using this API in Ruby.
Creates a new toolbar and Removes the current toolbar / tabbar 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’
Parameters
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.
Properties of Toolbar elements. Either :icon or :label must be specified. If both are specified, :icon is drawn and :label is discarded.
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.
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.
Platforms: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.
Platforms:WM, CE, Win32, iOS, Android
Expand application window to full screen.
Platforms:WM, CE, Win32, Android, WP8
Run full sync command.
Minimize application window.
Platforms:WM, CE, Win32
Display software keyboard window.Set Rho.System.keyboardState
to Rho.System.KEYBOARD_AUTOMATIC
to use this element.
WM
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.
Use colored icon in toolbar on iPhone instead of standard monochrome white icon (prepared from image alpha).
Platforms:iOSButton width in pixel. Used to define separator width when more than one separator specified.
Platforms:WMProperties of TabBar.
Background color of the toolbar.
Image mask color(transparent color).
Platforms:WM, CE, Win32Toolbar height in pixels.
Platforms:WM, CE, Win32Synchronous Return:
Method Access:
Rho.NativeToolbar.create(ARRAY toolbarElements, HASH toolBarProperties)
Rho::NativeToolbar.create(ARRAY toolbarElements, HASH toolBarProperties)
Removes the current toolbar. Does nothing if there is no active toolbar.
Synchronous Return:
Method Access:
Rho.NativeToolbar.remove()
Rho::NativeToolbar.remove()
Create a native Toolbar.
Rho.NativeToolbar.create([{ label: "Home", action: Rho.Application.startURI }, { label: "example.com", action: "http://www.example.org" }], {})
Rho::NativeToolbar.create([{ :label => "Home", :action => url_for(Rho::Application.startURI) }, { :label => "example.com", :action => "http://www.example.com", } ], {})
Remove the toolbar.
Rho.NativeToolbar.remove();
Rho::NativeToolbar.remove