iOS Question NavigationBar disabled with TabBarController?

Emme Developer

Well-Known Member
Licensed User
Hi everybody! I don't know why, but i don't see the navigationbar, after putting a tabbarcontroller.
I've 3 pages. First page is like a splash screen, so i've a button and disabled navigationbarvisible.
When i click on button, i need to show tabbarcontroller, in which each page as title and 2 custom button (left and right). This is my code. Anyone can help me? Thanks

This is the first page
B4X:
Private Sub Application_Start (Nav As NavigationController)
    Utils.loc.Initialize(File.DirAssets,"dgtran.db",False)
  
    NavControl = Nav
    MainPage.Initialize("Page1")
  
    MainPage.RootPanel.Color = Colors.White
    NavControl.ShowPage(MainPage)
  
    MainPage.RootPanel.LoadLayout("Main")
    NavControl.NavigationBarVisible = False
  
    tbc.Initialize("")
  
End Sub


Sub button1_Click
    Utils.CreateLayout
End Sub

B4X:
Sub CreateLayout
    Dim create As Boolean = true
  
    If create Then
        Main.App.KeyController = Main.tbc
      
        Dim no As NativeObject = Main.tbc
        no.GetField("tabBar").SetField("tintColor", no.ColorToUIColor(0xFFED7B53)) 'active item

  
        Dim tbb As TabBarItem
        tbb.Initialize("Scala grafica",LoadBitmap(File.DirAssets,"ios_menu_0_off.png"),LoadBitmap(File.DirAssets,"ios_menu_0_on.png"))
        Dim scal As Scala
        scal.Initialize()
        scal.GetPage.TabBarItem = tbb


        Dim tbb As TabBarItem
        tbb.Initialize("Analisi",LoadBitmap(File.DirAssets,"ios_menu_1_off.png"),LoadBitmap(File.DirAssets,"ios_menu_1_on.png"))

        Dim an As analisi
        an.Initialize()
        an.GetPage.TabBarItem = tbb
      
        Main.tbc.Pages = Array(scal.GetPage,an.GetPage)
    Main.NavControl.NavigationBarVisible = True


    End If
End Sub
 

Attachments

  • upload_2017-7-6_12-32-15.png
    upload_2017-7-6_12-32-15.png
    116 KB · Views: 221
  • upload_2017-7-6_12-35-7.png
    upload_2017-7-6_12-35-7.png
    44.8 KB · Views: 211
Top