iOS Question Close Page

BensonHung

Member
Licensed User
Longtime User
If I need close page.show, what can I do??
like B4A activity.finish or restart page.
thank you Everyone.

B4X:
Public Sub Show
    If pg.IsInitialized = False Then
        pg.Initialize("pg")
        pg.RootPanel.LoadLayout("LoginLayout")
    End If
    Main.NavControl.ShowPage(pg)
End Sub

Private Sub btnEnter_Click
    pg.ResignFocus
    Page1Module.Show      'In there,I need Close LoginModule back MainModule
End Sub
 
Last edited:

BensonHung

Member
Licensed User
Longtime User
thanks Erel,
After the test I found him to be able to use,
But when I re-enter the page, I found that my record before the operation has not been reset,
Will I have to how to do it?
 
Upvote 0

BensonHung

Member
Licensed User
Longtime User
The page is not destroyed. It is just removed from the stack.

You can remove the If pg.IsInitialized check and instead create a new page each time.

This is an example,
When I press the Enter input 123,
But when I press the Close Back to Previous Page,
After I press Enter again, 123 did not go away.
 

Attachments

  • 1.png
    1.png
    26.2 KB · Views: 243
  • 2.png
    2.png
    36.1 KB · Views: 252
  • TestB4I.zip
    29.5 KB · Views: 198
Upvote 0

BensonHung

Member
Licensed User
Longtime User
Edit this??
B4X:
    If pg.IsInitialized = False Then
        pg.Initialize("pg1")
        pg.RootPanel.LoadLayout("LoginLayout")
    End If
    Main.NavControl.ShowPage(pg)

very thank you Erel!!!
 
Upvote 0

BensonHung

Member
Licensed User
Longtime User
OK~I know how to do!!!
B4X:
'If pg.IsInitialized = False Then
        pg.Initialize("pg1")
        pg.RootPanel.LoadLayout("LoginLayout")
'End If
Main.NavControl.ShowPage(pg)
 
Upvote 0
Top