iOS Question Redisplay the back button after adding a TopLeftButton


Active Member
Licensed User
Longtime User
Is it possible to do the following:

1) Open a page, hide the back button and set a TopLeftButton to some new value
2) Perform some operation (Like display a Tableview) and then click the TopLeftButton to return to the same page I was on (Remove the Tableview)
3) Remove the TopLeftButton and then display the back button again with the original 'back' text that the page opened with


B4X founder
Staff member
Licensed User
Longtime User
Clearing the top left buttons will return the back key.

Check this example:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'Public variables can be accessed from all modules.
   Public App As Application
   Public NavControl As NavigationController
   Private Page1 As Page
   Private page2 As Page
End Sub

Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Title = "Page 1"
   Page1.RootPanel.Color = Colors.White
   page2.RootPanel.Color = Colors.Red
   Dim b1 As BarButton
   b1.InitializeText("abc", "abc")
   page2.TopLeftButtons = Array(b1)
End Sub

Sub Page1_Click
End Sub

Sub page2_BarButtonClick (Tag As String)
   If Tag = "abc" Then
     page2.TopLeftButtons = Array() '<----------------------
   End If
End Sub
Upvote 0