Spanish Como cambiar de paginas en b4xPages? [solucionado]

carlos7000

Well-Known Member
Licensed User
Longtime User
Hola.

Hice una pequeña aplicación en b4xpages, con 2 paginas. Una pagina principal y otra, digamos, secundaria. Al ejecutar el programa, el programa se ejecuta mostrando la pagina secundaria. Porque no muestra la pagina principal?

Adjunto el proyecto
 

Attachments

  • Project.zip
    15.5 KB · Views: 147

angel_

Well-Known Member
Licensed User
Longtime User
Prueba así:

B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private Page2 As ListaWaypoints
    
End Sub

Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True

End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    
    InitializePages
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
'    xui.MsgboxAsync("Hello world!", "B4X")
    B4XPages.ShowPage("Page 2")
End Sub

Private Sub InitializePages
    Page2.Initialize
    B4XPages.AddPage("Page 2", Page2)
End Sub
 

carlos7000

Well-Known Member
Licensed User
Longtime User
Prueba así:

B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private Page2 As ListaWaypoints
   
End Sub

Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True

End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
   
    InitializePages
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
'    xui.MsgboxAsync("Hello world!", "B4X")
    B4XPages.ShowPage("Page 2")
End Sub

Private Sub InitializePages
    Page2.Initialize
    B4XPages.AddPage("Page 2", Page2)
End Sub
Hola.

Muchas gracias.
 
Top