iOS Question how to set Page1 no navigation bar and Page2 show nagivation bar?

Keith Yong

Active Member
Licensed User
Longtime User
First of all, thanks for helping to answer my previous question and manage to resolve it.

Here is some example, page 1 is the login screen without the navigation bar, and page 2 is forgot password with showing the navigation bar and the back button.

Question 1: how do I preset the page 1 layout hide the navigation bar and page 2 show the navigation bar?

Question 2: how to I change the back button (Page 2) to white color?

img_8661-png.42764



img_8663-png.42765
 

Attachments

  • IMG_8661.PNG
    IMG_8661.PNG
    92.9 KB · Views: 1,130
  • IMG_8663.PNG
    IMG_8663.PNG
    103.4 KB · Views: 1,064

narek adonts

Well-Known Member
Licensed User
Longtime User
First of all, thanks for helping to answer my previous question and manage to resolve it.

Here is some example, page 1 is the login screen without the navigation bar, and page 2 is forgot password with showing the navigation bar and the back button.

Question 1: how do I preset the page 1 layout hide the navigation bar and page 2 show the navigation bar?

Question 2: how to I change the back button (Page 2) to white color?

img_8661-png.42764



img_8663-png.42765


1. Try to create 2 navigationController

Example

B4X:
Dim Nav1, Nav2 as NavigationController
Dim Page1,Page2 as Page

Sub CreatePages

Nav1.Initialize("")
Nav2.Initialize("")
Page1.Initialize("")
Page2.Initialize("")

nav1.NavigationBarVisible=false

nav2.showpage(page2)

nav1.Showpage(page1)

End Sub

Sub ChangePage

nav1.showpage(nav2)

end sub

2.

B4X:
Dim no as NativeObject=NavControl
no.getfield("navigationBar").setfield("tintColor",no.ColorToUIColor(youColor))
 
Last edited:
Upvote 0

Keith Yong

Active Member
Licensed User
Longtime User
1. Try to create 2 navigationController

Example
B4X:
Dim Nav1, Nav2 as NavigationController
Dim Page1,Page2 as Page

Sub CreatePages

Nav1.Initialize("")
Nav2.Initialize("")
Page1.Initialize("")
Page2.Initialize("")

nav1.NavigationBarVisible=false

nav2.showpage(page2)

nav1.Showpage(page1)

End Sub

Sub ChangePage

nav1.showpage(nav2)

end sub

2.

B4X:
Dim no as NativeObject=NavControl
no.getfield("navigationBar").setfield("tintColor",no.ColorToUIColor(youColor))

it seems like nothing show even I added the line to call CreatePages under Application_Start routine.

B4X:
Private Sub Application_Start (Nav As NavigationController)

CreatePages

End Sub
 
Upvote 0

Keith Yong

Active Member
Licensed User
Longtime User
You can use the Page_Appear event to hide or show the bar:
B4X:
Sub Page1_Appear
   NavControl.SetNavigationBarVisibleAnimated(False)
End Sub

Sub Page2_Appear
   NavControl.SetNavigationBarVisibleAnimated(True)
End Sub


Thanks Erel, however it looks like a bit weird when I call back the Page1 and hide the navigationbar, so I decided the Hide the NavigationBar and create a custom Panel on Page 2 with the Back button. But the challenge is how to set the gesture swipe from left back to Page 1?
 
Upvote 0
Top