iOS Question Modules vs. Pages

Carthalion

Member
Licensed User
Longtime User
This code is from Erel's Two Pages example. I am trying to use modules for each page. I have also been studying his Three Pages example, and it does use individual modules but the Three Pages code is too complex for me to follow. (If I can figure out the foundation for the modules, I can add the complexity later.)

Could anybody give me a simple example as in Two Pages, using modules instead of pages?

B4X:
'Code module
#Region  Project Attributes
    #ApplicationLabel: B4i Example
    #Version: 1.0.0
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
    #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#End Region

Sub Process_Globals
    Public App As Application
    Public NavControl As NavigationController
    Private Page1, Page2 As Page
End Sub

Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Page1.Initialize("Page1")
    Page2.Initialize("Page2")
    Page1.RootPanel.LoadLayout("1")
    Page2.RootPanel.LoadLayout("2")
    NavControl.ShowPage(Page1)
End Sub

Sub Button1_Click
    NavControl.ShowPage(Page2)
End Sub


Private Sub Page1_Resize(Width As Int, Height As Int)

End Sub

Private Sub Application_Active

End Sub

Private Sub Application_Inactive

End Sub

Private Sub Application_Background

End Sub
 
Last edited:

Carthalion

Member
Licensed User
Longtime User
This is actually great news. It explains why I couldn't figure out the code in the modules in Three Pages. I was looking for the way that it related to the pages when it didn't.
 
Upvote 0
Top