iOS Question SideMenu and TabBar

narek adonts

Well-Known Member
Licensed User
Longtime User
Hi,

I am trying to insert a SideMenu in my page which is using a Navigatation Controller which is inserted in TabBar Controller. But it doesnt work.
Can you advise the solution please,

Code:

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Public NavControl As NavigationController
    Private Page1,page2 As Page
    Dim smc As SideMenuController
    Dim tbc As TabBarController
End Sub

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
   tbc.Initialize("tbc")
   'Page1.RootPanel.LoadLayout("1")
   page2.Initialize("page2")
   page2.RootPanel.Color=Colors.Magenta
   page2.Title="Page2"
   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")

   tbc.Pages=Array(nc,page2)

  
   App.KeyController=tbc
   smc.Initialize(lp, nc, rp)

   nc.ShowPage(Page1)
   Page1.TopRightButtons = Array(smc.CreateBarButton("right"))
   Page1.TopLeftButtons = Array(smc.CreateBarButton("left"))
End Sub
 

narek adonts

Well-Known Member
Licensed User
Longtime User
Hi
It seem correct.
you have problem in tabbar and navbar or one of them?


this the Log.

When I am pressing on any TabBatItem it gives the error.



*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]
Stack Trace: (
CoreFoundation <redacted> + 160
libobjc.A.dylib objc_exception_throw + 60
CoreFoundation <redacted> + 0
UIKit <redacted> + 40
UIKit <redacted> + 96
UIKit <redacted> + 468
UIKit <redacted> + 96
UIKit <redacted> + 612
UIKit <redacted> + 128
UIKit <redacted> + 96
UIKit <redacted> + 612
UIKit <redacted> + 592
UIKit <redacted> + 8536
CoreFoundation <redacted> + 32
CoreFoundation <redacted> + 360
CoreFoundation <redacted> + 836
CoreFoundation CFRunLoopRunSpecific + 396
GraphicsServices GSEventRunModal + 168
UIKit UIApplicationMain + 1488
B4i Example main + 116
libdyld.dylib <redacted> + 4
)
 
Upvote 0

narek adonts

Well-Known Member
Licensed User
Longtime User
When I am adding SlideControl to TabBarController directely ist partially works, but the issue is that the Page height is not correct. Please see images

Narek
 

Attachments

  • image.jpg
    image.jpg
    32.7 KB · Views: 291
  • image.jpg
    image.jpg
    32.4 KB · Views: 296
Upvote 0
Top