iOS Question SideMenu and TabBar

Discussion in 'iOS Questions' started by narek adonts, Feb 21, 2015.

  1. narek adonts

    narek adonts Well-Known Member Licensed 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:

    Code:
    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
     
  2. omidaghakhani1368

    omidaghakhani1368 Well-Known Member Licensed User

    Hi
    It seem correct.
    you have problem in tabbar and navbar or one of them?
     
  3. narek adonts

    narek adonts Well-Known Member Licensed User


    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
    )
     
  4. narek adonts

    narek adonts Well-Known Member Licensed 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
     

    Attached Files:

  5. Erel

    Erel Administrator Staff Member Licensed User

    The SideMenu library only works properly with navigation controllers.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice