iOS Question NavBar after switching from TabControl to NavControl

ciginfo

Active Member
Licensed User
Impossible to have a NavBar after switching from TabControl to NavControl.
I have a Tabbar with 3 items (Page1, Page2, page3). A button on Page1 which switches to NavControl and opens Page4 when clicking. I do not have on Page4 a NavBar with BackButton to come back to Page1.
Look at zip file joined.
How can I do?
Thank you
 

Attachments

klaus

Expert
Licensed User
The problem is that you must add the back button yourself because you launch Page4 with button and not with the NavicationController.
Attached a modified version.
 

Attachments

ciginfo

Active Member
Licensed User
Thank you, it works fine. But I do not understand a line.
NavControl.ShowPage(Page4)
Because when I click on back button it does not show Page4 but Page1
B4X:
Sub Page4_BarButtonClick (Tag As String)
    Select Tag
    Case "Page1"
       
        NavControl.ShowPage(Page4)
        App.KeyController = TabControl

    End Select
End Sub
 

klaus

Expert
Licensed User
NavControl.ShowPage(Page4)
should have been
NavControl.ShowPage(Page1)
It seems that with App.KeyController = TabControl iOS goes back to page1.
I commented NavControl.ShowPage(Page4) and it goes back to page 1.
 

valentino s

Active Member
Licensed User
Just to highlight that this example is perfect to learn tabbarcontroller, keycontroller, the navcontroller and others things. The chart example is not as useful as this one.
Thank you very much.
 
Last edited:

jazzzzzzz

Active Member
Licensed User
How can we give the transition animation when clicking on the custom back button we created by this example?

Now it just shows the page without sliding animation,but usually when pressing the auto generated navigation bar back button will produce a sliding animation I need that too in this case..

Any ideas ?
 

Erel

Administrator
Staff member
Licensed User
There will not be any transition in this case as the transition is handled by the NavigationController when it changes internal pages.
 

Erel

Administrator
Staff member
Licensed User
I did try several things however they didn't work. You can try to add a "dummy" page before page 4 and switch to the tab controller when the dummy page appears (only after page4 appeared).
 

jazzzzzzz

Active Member
Licensed User
I did try several things however they didn't work. You can try to add a "dummy" page before page 4 and switch to the tab controller when the dummy page appears (only after page4 appeared).
dummy page is a nice idea,But the animation is too short,I have tested.
 
Top