AddListMobileItem()

Syntax

AddListMobileItem(#Mobile, Text$ [, Flags]])
Description
Add a new item to the specified mobile list previously created with ListMobile().

Parameters

#Mobile The mobile list to use.
Text$ The text for the new item.
Flags (optional) It can be a combination (using the bitwise OR operator '|') of the following constants:
  #PB_Mobile_Chevron     : Add a chevron mark to to the item, useful with #PB_Mobile_Tappable.
  #PB_Mobile_NoDivider   : Remove the line divider below the item.
  #PB_Mobile_LongDivider : Display a longer divider below the item.
  #PB_Mobile_Expandable  : The item expands when the user click on. This automatically opens a new container where mobile items can be added. Once finished, it has to be closed with CloseMobileContainer().
  #PB_Mobile_Tappable    : Creates a tappable item, which generate a #PB_EventType_LeftClick event.
  #PB_Mobile_Header      : The item will be an header item which can be useful to group items by categories. 
  #PB_Mobile_Container   : The item will be a 3 slots container (left, center, right). Once the mobile objects added, it has to be closed with CloseMobileContainer().

Return value

None.

Example

  If ContainerMobile(#PB_Any, #PB_Mobile_Page)
    ListMobile(0)
    AddListMobileItem(0, "Header", #PB_Mobile_Header)
    AddListMobileItem(0, "Basic item")
    AddListMobileItem(0, "Basic item 2")
    
    ; List item with a container With 3 placeholder: left, center, right
    If AddListMobileItem(0, "Hello", #PB_Mobile_Container)
      TextMobile(#PB_Any, "PopOver", #PB_Mobile_Left)
      ButtonMobile(1, "Open PopOver !", #PB_Mobile_Center)
      SwitchMobile(2, #PB_Mobile_Right)
      CloseMobileContainer() ; Important to close the container once the item have been added
    EndIf
    
    AddListMobileItem(0, "Another title", #PB_Mobile_Header)
    AddListMobileItem(0, "Chevron", #PB_Mobile_Chevron | #PB_Mobile_Tappable)
    
    ; Expandable list item 
    If AddListMobileItem(0, "Expandable", #PB_Mobile_Expandable)
      ButtonMobile(1, "Hidden button !")
      CloseMobileContainer() ; Important to close the container once the item have been added
    EndIf
  EndIf

See Also

ListMobile(), CloseMobileContainer()

Supported OS

All

Mobile Index - AddTabBarMobileItem() ->