1

In my app which is a combination of UITabBarController and UINavigation Controller. I have a tab where I would like to make the tab bar at the bottom dissappear upon loading and reappear when the bottommost UITableviewcell on that tab's UItableview is clicked. To accomplish this I implemented this method:

-(void)viewWillAppear:(BOOL)animated

{ self.navigationController.tabBarController.tabBar.hidden = true; }

Then I implemented another method

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:

(NSIndexPath *)indexPath { self.navigationController.tabBarController.tabBar.hidden = false; }

All good, it works. However, the area where the tab-bar was before dissappearing is not transparent. There is white band and the tableview underneath is not seen. While the whole point of making the tab bar dissapear was so that there is more screen realestate and the views underneath can be seen.

How do I solve this issue. Im sure there is a setting somewhere, just can't figure it out. Could someone please help me.

Thanks

1 Answer 1

0

This is because the view itself does not fill the whole screen, only the areas outside the tab bar. Hiding the tab bar will not resize the view.

View area

The easiest way to overcome this is to create a new view, which fills the entire screen (thus, not part of the tab bar controller), and push that when needed:

- (IBAction)buttonPressed:(id)sender {

    ThirdViewController *third = [[ThirdViewController alloc] initWithNibName:@"ThirdView" bundle:nil];
    [self.navigationController pushViewController:third animated:YES];

    [[[UIApplication sharedApplication] keyWindow] addSubview:third.view];

    [third release];
}
2
  • wow create a new view just for this. Ive already implemented everything, that means starting from the scratch :(
    – banditKing
    Apr 2, 2011 at 17:42
  • Hmm, I added a new View to my xiB file and this time it was of the full height of the iPhone: 460. But that didn't solve this problem.....
    – banditKing
    Apr 2, 2011 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.