The NativeTabbar methods let you use multiple instances of the RhoMobile webview in separate tabs. On Android, iOS and WIndows Phone 8 the tabs are true Native Tabbar controls to give your application a native look and feel.
No more than 4 tabs can be created in the Windows Phone 8 tabbar. A tabbar separator doesn’t exist in Windows Phone 8. On Windows Mobile/CE there are no visible tabs. At one time only Toolbar or Tabbar can present in application – Toolbar and Tabbar can not be used both in one 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 tabbar / toolbar and replaces it with this one. Callback will be called when tab is switched.
Parameters
Array of Tab elements.
Properties of Tab elements.
Visible label to display on the tabbar.
URL to page which will be loaded into tab. Predefined actions are not supported. 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: methodOnTab();’. Or path to html page to load.
Relative path to tabbar item icon in your rhodes app; typically located in /public/images/.
Platforms:Win32, Android, iOS, WP8When tab is activated – page in tab will be reloaded.
Change the selected color of this tab. On Android this works only if you setup selectedColor for all tabs and also setup backgroundColor for the whole Tabbar.
Platforms:Win32, Android, iOS, WP8Tab will be displayed as disabled.
Platforms:Win32, Android, iOS, WP8Background color for tab. Use when your application background color is not white for removing blink during switch tabs.
Platforms:Win32, Android, iOS, WP8Gives a smooth transfer to a newly opened tab from the current view into this Tab and make this Tab active. Only one Tab can have this parameter.
Platforms:WM, Win32, Android, iOSSets whether this tab is allowed to be destroyed when a memory limit is reached (Windows Mobile)
Platforms:WMCreate tab immediately when TabBar is created. Action also will be executed. If false, the tab will be created when it is switched to.
Platforms:WMProperties of TabBar.
Creates a vertical tabbar on the iPad.
Platforms:iOSBackground color of the tabbar.
Platforms:Win32, Android, iOS, WP8Do not display Tabs with labels.Only hiddenTab=true is currently supported.
Platforms:WMCreate tabs immediately when TabBar is created. Action also will be executed. If false, then each tab will be created when first switch to the tab is executed.
Platforms:WMPlace TabBar to bottom instead of default top – only for Android.
Platforms:AndroidAsync Callback Returning Parameters: HASH
New tab index.
New tab index.
Platforms:WMNew tab index. If you switched to first activated tab, when oldTabIndex will be -1, which means that there was no old tab index exists.
Platforms:WMPlatforms:WM
Possible Values :
Fires when a tab gains focus.
Fires when a new tab cannot be created.
Synchronous Return:
Method Access:
Rho.NativeTabbar.create(ARRAY tabElements, HASH tabBarProperties, CallBackHandler callback)
Rho::NativeTabbar.create(ARRAY tabElements, HASH tabBarProperties, CallBackHandler callback)
Returns the current tab 0-based index.
Synchronous Return:
Method Access:
Rho.NativeTabbar.currentTabIndex()
Rho::NativeTabbar.currentTabIndex()
Removes the current tabbar. Does nothing if there is no active tabbar.
Synchronous Return:
Method Access:
Rho.NativeTabbar.remove()
Rho::NativeTabbar.remove()
Removes the Tab by index. Method will remove the WebView for the specific tab, it will not remove the tab from the tab array, so all indexes will remain the same.You cannot delete the tab with useCurrentViewForTab flag.If you switch to previously removed tab, tab will be recreated.
Parameters
The index for tab (index numbered from 0) to delete.
Synchronous Return:
Method Access:
Rho.NativeTabbar.removeTab(INTEGER tabIndex)
Rho::NativeTabbar.removeTab(INTEGER tabIndex)
Set the iPhone badge to tab.
Parameters
The index for this tab (index numbered from 0). You can also set -1 to select current tab for set badge.
String for iPhone badge, such as ‘12’.
Synchronous Return:
Method Access:
Rho.NativeTabbar.setTabBadge(INTEGER tabIndex, STRING badge)
Rho::NativeTabbar.setTabBadge(INTEGER tabIndex, STRING badge)
Switch active tab.
Parameters
The index for this tab (index numbered from 0).
Synchronous Return:
Method Access:
Rho.NativeTabbar.switchTab(INTEGER tabIndex)
Rho::NativeTabbar.switchTab(INTEGER tabIndex)
Create a platform-native tabbar. Tabs can link to internal application links (such as those built with “url_for”) as well as external URLs.
function create_tabbar() { Rho.NativeTabbar.create([{ label: "Home", action: "/app" }, { label: "example.com" action: "http://www.example.com" }], {}, tabbar_callback ); } function tabbar_callback(params) { alert("Switching to tab "+params["tab_index"]); }
def create_tabbar Rho::NativeTabbar.create([{ :label => "Home", :action => url_for(Rho::Application.startURI) }, { :label => "example.com", :action => "http://www.example.com", }], {}, url_for(:action => :tabbar_callback) ) end def tabbar_callback Alert.show_popup("Switching to tab #{@params["rab_index"]}") end
Switch the active tab.
// Make the third tab active Rho.NativeTabbar.switchTab(2);
# Make the third tab active Rho::NativeTabbar.switchTab(2);
Remove the tabbar.
Rho.NativeTabbar.remove();
Rho::NativeTabbar.remove