1

I have implemented UITabBarController in my applicationm. The code of it is as follows:

MainCollection *mainView = [[MainCollection alloc] initWithNibName:@"MainCollection" bundle:nil];
    UINavigationController *mainNav = [[UINavigationController alloc] initWithRootViewController:mainView];

    mainView = (MainCollection *)mainNav.topViewController;
    mainView.managedObjectContext = self.managedObjectContext;

    ShowFavourites *showVC = [[ShowFavourites alloc] initWithNibName:@"ShowFavourites" bundle:nil];
    UINavigationController *showNav = [[UINavigationController alloc] initWithRootViewController:showVC];
    showNav.title=@"Favourites";
     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    UITabBarController *tabBar = [[UITabBarController alloc] init];

    [tabBar setViewControllers:@[mainNav,showNav]];

    [self.window setRootViewController:tabBar];

    [self.window makeKeyAndVisible];


    return YES;

My first Screen is MainCollection I should show tabBar in this view. suppose the next view is SubCategory but when I navigate to SubCategory, on this view I want to hide Tabbar then How can I hide it or remove it from only SubCategory view?

Any Idea?

Thanks in advance.

iPhone
  • 4,092
  • 3
  • 34
  • 58

2 Answers2

5

This has a very simple solution. You should have tried harder. In the View in which you want to hide the UITabBar simply add

self.hidesBottomBarWhenPushed = YES;

Here access these links for SO itself. You will easily find the answer :-

Show/Hide TabBarController in iphone

How to hide uitabbarcontroller

How to Hide Tab Bar Controller?

Is it possible to hide the tabbar when a button is pressed to allow a full screen view of the content?

How to hide UITabBarController programmatically?

How to hide an iPhone Tab Bar?

Community
  • 1
  • 1
IronManGill
  • 7,222
  • 2
  • 31
  • 52
3

There is no need to hide the tabbar just use parent navigation controller for push to subcategory screen

[self.tabBarController.navigationController pushViewController:subCategoryObj animated:YES]; 

Thanks,

Raj
  • 1,213
  • 2
  • 16
  • 34
  • This is not advisable because when setting `self.title` in the pushed view controller it will not update the navigation controller. The other answer is far better. – vaughan Aug 12 '14 at 19:23