iOS Question How to use B4XPages with TabBarController?

Zhien

Member
Licensed User
I am trying to create some simple pages with toolbars at the bottom that I created using the Designer.

How do I call each page when the user clicks on the icons inside the toolbar?

This is my attempt below, which gives me an error.
-[b4i_b4xmainpage _setViewHostsLayoutEngine:]: unrecognized selector sent to instance 0x283dc4b90

B4XPages + TabBarController attempt:
Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Dim PagesManager As B4XPagesManager
    PagesManager.Initialize(NavControl)
    
    Dim tbc As TabBarController
    tbc.Initialize("tbc")
    App.KeyController = tbc
    
    pgBagList.Initialize
    
    pgMain.Initialize
    
    mainNav.Initialize("mainNav")
    B4XPages.AddPage("bagList", pgBagList)
    
    tbc.Pages.Initialize
    tbc.Pages = Array(pgMain, pgBagList)
    
    
End Sub


Sub pgMain_Click
    
    B4XPages.ShowPage("MainPage")
    
End Sub
 

Zhien

Member
Licensed User
Never mind, apparently TabBarController.Pages() only accepts regular B4i pages arrays, and not B4XPages.
So I will use B4XPagesNavBar project example explained in the documentation instead.
 
Last edited:
Upvote 0
Top