iOS Question iSideMenu

mrossen

Active Member
Licensed User
Longtime User
Hi,

Is there anyone there got the iSideMenu to Work.

I have tried:

B4X:
NavControl = Nav
   
    Page1.Initialize("Page1")
    Page2.Initialize("Page2")
    Page1.Title = "Page 1"
    Page1.RootPanel.Color = Colors.White
    Page1.RootPanel.LoadLayout("main")
    Page2.RootPanel.LoadLayout("pincard")
   
    NavControl.ShowPage(Page1)
   
    SideControl.Initialize("Page2", NavControl, Null)
   
    SideControl.OpenGesturesEnabled = True
    SideControl.CreateBarButton("sm")

Mogens
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
See the attached example.

You need to make the SideManagerController the main controller:
B4X:
Private Sub Application_Start (Nav As NavigationController)
   'create a new navigation controller   
   Dim nc As NavigationController
   nc.Initialize("nc")
   NavControl = nc
   Page1.Initialize("Page1")
   Page1.Title = "Page 1"
   Page1.RootPanel.Color = Colors.White
   Page1.RootPanel.LoadLayout("1")
   Dim lp As Page
   lp.Initialize("lp")
   lp.RootPanel.Color = Colors.Red
   lp.RootPanel.LoadLayout("1")
   Dim rp As Page
   rp.Initialize("rp")
   rp.RootPanel.Color = Colors.Green
   rp.RootPanel.LoadLayout("1")
   smc.Initialize(lp, nc, rp)
   App.KeyController = smc
   nc.ShowPage(Page1)
   Page1.TopRightButtons = Array(smc.CreateBarButton("right"))
   Page1.TopLeftButtons = Array(smc.CreateBarButton("left"))
End Sub
Note that we don't use the Nav parameter at all.
 

Attachments

  • SideMenu.zip
    2.5 KB · Views: 1,104
Upvote 0

mrossen

Active Member
Licensed User
Longtime User
Hi Erel,

Thank you for this code example. I am wondering, is it possible to use the sidemenu with the tabcontroller?

Mogens
 
Upvote 0

cloner7801

Active Member
Licensed User
Longtime User
See the attached example.

You need to make the SideManagerController the main controller:
B4X:
Private Sub Application_Start (Nav As NavigationController)
   'create a new navigation controller  
   Dim nc As NavigationController
   nc.Initialize("nc")
   NavControl = nc
   Page1.Initialize("Page1")
   Page1.Title = "Page 1"
   Page1.RootPanel.Color = Colors.White
   Page1.RootPanel.LoadLayout("1")
   Dim lp As Page
   lp.Initialize("lp")
   lp.RootPanel.Color = Colors.Red
   lp.RootPanel.LoadLayout("1")
   Dim rp As Page
   rp.Initialize("rp")
   rp.RootPanel.Color = Colors.Green
   rp.RootPanel.LoadLayout("1")
   smc.Initialize(lp, nc, rp)
   App.KeyController = smc
   nc.ShowPage(Page1)
   Page1.TopRightButtons = Array(smc.CreateBarButton("right"))
   Page1.TopLeftButtons = Array(smc.CreateBarButton("left"))
End Sub
Note that we don't use the Nav parameter at all.

Why
B4X:
smc.CloseMenu
Not work?
 
Upvote 0
Top