iOS Question NavigationBar inside TabBarController

Discussion in 'iOS Questions' started by narek adonts, Feb 14, 2015.

  1. narek adonts

    narek adonts Well-Known Member Licensed User

    Hi, I would like to use a navigation bar inside a specific page to be able to show other pages which are not stored inside TabBarController (like a lot of apps are doing like WhatsApp, Viber,... )
    Please advise the solution.

    Narek
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    See this example:
    Code:
    Sub Process_Globals
       
    Public App As Application
       
    Private Page1, page2, page3 As Page
       
    Private tbc As TabBarController
       
    Dim nav1 As NavigationController
    End Sub

    Private Sub Application_Start (nav As NavigationController)
       tbc.Initialize(
    "tbc")
       App.KeyController = tbc
       Page1.Initialize(
    "Page1")
       Page1.Title = 
    "Page 1"
       Page1.RootPanel.Color = 
    Colors.White
       
       nav1.Initialize(
    "nav1")
       tbc.Pages = 
    Array(Page1, nav1)
       page2.Initialize(
    "page2")
       page2.RootPanel.Color = 
    Colors.Green
       page2.Title = 
    "Page 2"
       page3.Initialize(
    "page3")
       page3.RootPanel.Color = 
    Colors.Red
       page3.Title = 
    "Page 3"
       nav1.ShowPage(page2)
    End Sub

    Sub Page2_Click
       nav1.ShowPage(page3)
    End Sub
    upload_2015-2-15_9-20-39.png
     
  3. narek adonts

    narek adonts Well-Known Member Licensed User

    Thank you. I think this is a feature that almost everybody would be happy to know. Thank you.
    But the next issue relating this is that when I am adding NavigationCotroller to TabBarController i am not able to set a TabBarItem to that page to be able to change the font,...
    Please advise this solution also.

    Thank you
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Try to set Page2 (from this example) tab bar item.
     
  5. narek adonts

    narek adonts Well-Known Member Licensed User

    It is not working that way.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    You can set the navigation controller tab item with this code:
    Code:
    Dim p As Page = nav1
    Dim tbb As TabBarItem
    tbb.Initialize(
    "asldjlaksdj"NullNull)
    p.TabBarItem = tbb
     
  7. narek adonts

    narek adonts Well-Known Member Licensed User

    thnks. Works Great
     
  8. fishwolf

    fishwolf Active Member Licensed User

    i have create a project with this code, but it doesn't show the navbar.

    i need a page with a nav bar (page1, page2, page3) and on page 2 a navbar + toolbar (page2A, page2B)

    is it possible? can you show me the code, please?

    Thanks
     
  9. narek adonts

    narek adonts Well-Known Member Licensed User

  10. jazzzzzzz

    jazzzzzzz Active Member Licensed User

    I have the same code in my project which have tabcontrol and nav control at same page,But my issue us that tabBarItem text is not changing to what i set there.Now the tabrBarItem text is coming as the title of the page shown by nav control...Any idea why that happens?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice