I want to have left and right buttons at the top of the window, in the middle part the title
B4X:
Dim bbt1, bbt2 As BarButton
Page1.Title="GURU"
bbt1.InitializeText("<Exit.","Exit")
bbt2.InitializeText("Start>","Start")
Page1.TopLeftButtons.Add(bbt1)
Page1.TopRightButtons.Add(bbt2)
The title appears and the buttons on the sides do not
It is a mistake to build the layout programmatically. Especially in B4J and B4i (see the B4i / B4J - Resize event video tutorial to understand why: https://www.b4x.com/etp.html).
Take the time to learn to use the designer. It will be worth it.
Thanks for the advice, I learned how to create Top Right Buttons on the topbar. I successfully created them with the help of the designer and in manual mode. But I do not understand how to set the code that will be executed when I press this button. In your video tutorial I did not find the answer. There is no such example in the user's Guide B4i. I tried to create a procedure like Sub bbt1_click but it does not work.
B4X:
Dim bbt1 as BarButton, bbt2 as BarButton
bbt1.InitializeText("DO","TAGg")
Page1.TopRightButtons=Array(bbt1)
Private Sub TAGg_Click
or
Private Sub TAGg_BarButtonClick
or
Private Sub bbt1_BarButtonClick
or
Private Sub Page_BarButtonClick ->(from Guide)
or ?
In the design, it is possible. For simple Button I without problem generate Sub for Click event but for the barbaton this option is not found.
' Page1 ToolBar buttons event routine
Private Sub Page1_BarButtonClick (Tag As String)
Select Tag
Case "Exit"
' your code
Case "Start"
' your code
End Select
End Sub
Example extracted from the UINavBar example program in the B4i Beginner's Guide SourceCode.