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
Removes the current toolbar/tabbar and replaces it with this one.
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 :
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:iOS
Button width in pixel. Used to define separator width when more than one separator specified. Platforms:WM
Properties of TabBar.
Background color of the toolbar.
Image mask color(transparent color). Platforms:WM, Win32
Toolbar height in pixels. Platforms:WM, Win32
Synchronous 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()
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", } ], {})
Rho.NativeToolbar.remove();
Rho::NativeToolbar.remove