AddTabBarMobileItem()

Syntax

AddTabBarMobileItem(#Mobile, Text$, Icon$, ActiveIcon$, Page$ [, NbBadges])
Description
Add a new tab to the current tabbar previously created with TabBarMobile(). Once all tabs have been added, CloseMobileContainer() needs to be called. It's not possible to add more tabs once CloseMobileContainer() have been called.

Parameters

#Mobile The mobile object to use.
Text$ The displayed label of the tab. If empty, then the tab won't have a label displayed (only the icon).
Icon$ The name of the icon to display. See IconMobile() for more info about icon naming.
ActiveIcon$ The name of the active icon (displayed if the tab is the current active tab). See IconMobile() for more info about icon naming.
Page$ The case-sensitive name of the page to use. It needs to be a ContainerMobile() created with the #PB_Mobile_Template type.
NbBadges (optional) The number of badge to display over the icon. If 0, nothing is displayed.

Return value

None.

Example

  ; Template page 1 for the TabBar.
  ;
  If ContainerMobile(#PB_Any, #PB_Mobile_Template, "", "tab1")
    HtmlMobile("Tab 1")
    CloseMobileContainer()
  EndIf

  ; Template page 2 for the TabBar
  ;
  If ContainerMobile(#PB_Any, #PB_Mobile_Template, "", "tab2")
    HtmlMobile("Tab 2")
    CloseMobileContainer()
  EndIf

  ; Template page 3 for the TabBar
  ;
  If ContainerMobile(#PB_Any, #PB_Mobile_Template, "", "tab3")
    HtmlMobile("Tab 3")
    CloseMobileContainer()
  EndIf

  ; This is the main page
  ;
  If ContainerMobile(#PB_Any, #PB_Mobile_Page, "", "")
    
    If TabBarMobile(0, #PB_Mobile_Swipeable)
      AddTabBarMobileItem(0, "", "md-face", "md-face", "tab1")
      AddTabBarMobileItem(0, "Info", "", "", "tab2")
      AddTabBarMobileItem(0, "Params", "md-settings", "md-settings", "tab3", 5)
      CloseMobileContainer()
    EndIf

    CloseMobileContainer()
  EndIf

See Also

TabBarMobile()

Supported OS

All

<- AddListMobileItem() - Mobile Index - AlertMobile() ->