Search code examples
iosobjective-cuitableviewios6uitabbarcontroller

Black bar at the bottom in IOS6 instead UITabBarController


I have two viewController (A,B), when I launch my app my root is a viewController A. He has an UitableView and an UITabBarController at the bottom. When I click in my UitableView I go to my viewController B.

My issue is that when I arrive in my viewController B, I have a black bar at the bottom of my view as if my UITabBarController stay, but I don't think it's that because I have the issue only on IOS 6.

And I don't want to see a UITabBarController in my viewController B, I want to have a simple view with a UiWebView but she doesn't go at the bottom.

In my viewController B in viewWillAppear I do [self._tabBarControllerArticle.tabBar setHidden:YES];

I have IOS 6/7 Deltas with Delta Y (20 or -20) with all components in my viewController B.

The result are good for IOS 7.

I don't know how can I resolve that.


Solution

  • When click on table cell call hideTabBar as given below

      - (void)hideTabBar:(UITabBarController *) tabbarcontroller
     {
     [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    
    for(UIView *view in tabbarcontroller.view.subviews)
    {
        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
        }
    }
    
    [UIView commitAnimations];   
    }
    
     - (void)showTabBar:(UITabBarController *) tabbarcontroller
     {       
      [UIView beginAnimations:nil context:NULL];
      [UIView setAnimationDuration:0.5];
    for(UIView *view in tabbarcontroller.view.subviews)
    {
        NSLog(@"%@", view);
    
        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)];
    
        } 
        else 
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
        }
    }
    
    [UIView commitAnimations]; 
    }
    

    Show again when again come to the controller A again.