romaonthego / RESideMenu

iOS 7/8 style side menu with parallax effect.
MIT License
7.1k stars 1.35k forks source link

TabController with multiple navigation controller, trouble adding RESideMenu #234

Closed JulesMoorhouse closed 9 years ago

JulesMoorhouse commented 9 years ago

I have a UITabController set at my rootViewController and I have multiple UINavigationControllers. I want to add a RESideMenu to my first UIViewController of my first UINavigation Controller.

This is my setup...

self.tabBarController.viewControllers = [NSArray arrayWithObjects:navController1, 
     navController2, navController3, navController4, navController5, nil];

self.window.rootViewController = self.tabBarController;

I have been using an old side menu and I've tried to rework this to use RESideMenu, with a little success, however my tab bar appears on the side menu and not my first view and I have a gap in my first view where it should be, I've not been able to figure out how to fix this ...

self.tabBarController.viewControllers = [NSArray arrayWithObjects:[self MySideMenu], 
    navController2, navController3, navController4, navController5, nil];

- (RESideMenu *)MySideMenu {
SideMenuViewController *leftSideMenuController = [[SideMenuViewController alloc] init];

UIViewController *vcCB = [[CBViewController alloc]
                 initWithNibName:@"CBView" bundle:nil];

UINavigationController *navController1 = [[UINavigationController alloc]
                                          initWithRootViewController:vcCB];
navController1.tabBarItem.title = @“One”;

navController1.navigationBar.translucent = NO;
navController1.navigationBar.barStyle = UIBarStyleDefault;

RESideMenu *sideMenu = [[RESideMenu alloc] initWithContentViewController:navController1
    leftMenuViewController:leftSideMenuController
    rightMenuViewController:nil];

sideMenu.delegate = self;

return sideMenu;
}

My old side menu had navigationController around the method call, however this doesn't show anything except a black screen with a white bar at the bottom

self.tabBarController.viewControllers = [NSArray arrayWithObjects:
   [self MySideMenu].navigationController, 
   navController2, navController3, navController4, navController5, nil];

One other thing that I have

sideMenu.sideMenu = sideMenu;

Which is a property in my first UIViewController.

Can anyone help me out please :( ?

JulesMoorhouse commented 9 years ago

Ahhhh obviously I needed to follow the tab bar example and add the side menu as the root and as my tab bar as my content view controller :) Then the tab bar controller has all the navigation controllers as before :)

tekatool commented 9 years ago

how do i navigate programmatically between the two content view controllers (one is tabbar controller with multiple tabs in nav controller & another one is a view controller in nav controller?

Omarj commented 7 years ago

@Jules2010 did not work for me ?

JulesMoorhouse commented 7 years ago

@omarj follow the example, build that up towards your apps setup each step at a time. Worked for me.