0

I am using JaSidePanels for an application. I want to open a Sidepanel in one of the tabs of UITabBarController and then hide the tabBar like facebook does, but only in one of the three tabs.

After I make login in my app. A TabBarController appears with three Tabs. In one of these three tabs I want to show a Side Panel to do Filter requests, If I add JaSidePanelController to the tabController I can do that but I can not hide the Tab Bar. Another option is to store all the ViewController in a NavigationController and this navigation in the JaSidePanelController.centerPanel = navigationController; but then in each Tab I can open the SidePanel and also see the open Side panel button. I have tried to hide the button but I have not could. Any idea?

This is my code, what I use is the second option:

UITabBarController *tabBarController = [[UITabBarController alloc] init];
WPPlansViewController *plansVC = [[WPPlansViewController alloc] init];

plansVC.title = @"Mis planes";
WPStoreListViewController *sherpaVC = [[WPStoreListViewController alloc] init];
sherpaVC.title = @"Be Sherpa";
WPProfileViewController *profileVC = [[WPProfileViewController alloc] init];
profileVC.title = @"Perfil";

[tabBarController setViewControllers:@[plansVC,sherpaVC,profileVC]];
[tabBarController setSelectedIndex:1];

JASidePanelController *jaSidePanelVC = [[JASidePanelController alloc] init];
jaSidePanelVC.shouldDelegateAutorotateToVisiblePanel = NO;

jaSidePanelVC.leftPanel = [[WPFilterSidePanelViewController alloc] init];
UINavigationController *nav4 = [[UINavigationController alloc] initWithRootViewController:tabBarController];
nav4.navigationBar.topItem.title = nil;


jaSidePanelVC.centerPanel = nav4;
jaSidePanelVC.rightPanel = nil;

[self presentViewController:jaSidePanelVC animated:NO completion:nil];
croigsalvador
  • 1,993
  • 2
  • 24
  • 47

1 Answers1

0

Why can't you hide the tabbar? In the UITabBarController (subclass it) change the frame for self.tabBar to go offscreen, like this:

[UIView animateWithDuration:0.3 animations:^{
            [self.tabBar setFrame:CGRectMake(self.tabBar.frame.origin.x, self.view.frame.size.height, self.tabBar.frame.size.width, self.tabBar.frame.size.height)];
    }];

You can hide the tabBar when the sidePanel is displayed.

About the button, maybe you're referring to the leftButtonForCenterPanel, you can easily remove it whenever needed.

Fr4ncis
  • 1,387
  • 1
  • 11
  • 23