iOS Question Adding Views to NavigationBar

narek adonts

Well-Known Member
Licensed User

Erel

Administrator
Staff member
Licensed User
You can add custom views with BarButton.InitializeCustom.
For example the following code adds a TextField:
B4X:
Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Initialize("Page1")
   Page1.Title = "Page 1"
   Page1.RootPanel.Color = Colors.White
   NavControl.ShowPage(Page1)
   Dim bb As BarButton
   Dim tf As TextField
   tf.Initialize("tf")
   tf.HintText = "Enter something"
   tf.SetLayoutAnimated(0, 1, 0, 0, 100, 30)
   bb.InitializeCustom(tf)
   Page1.TopRightButtons = Array(bb)
End Sub
You can always remove the navigation bar and add a regular panel instead.
 
Top