0

I have an UITableView with TabBar (BottomBar) and ToolBar. When selecting a cell the detailsView is push to the stack. The detailsView does not have a TabBar nor a ToolBar. This is done within the prepareForSegue method:

...
if ([segue.identifier isEqualToString:@"ShowDetails"])
{
    ...
    editDetailsViewController.hidesBottomBarWhenPushed = YES;    // for hiding the TabBar
    [self.navigationController setToolbarHidden:YES];   // for hiding the toolbar
}

Now everything work fine but when the cell is selected the ToolBar is switched off immediately in the table view immediately before the detailsView is shown. How do I prevent that behavior? The ToolBar and TabBar should move together without switching off either of them?

Thanks!

JFS
  • 2,992
  • 3
  • 37
  • 48

2 Answers2

1

This part is fine:

...
if ([segue.identifier isEqualToString:@"ShowDetails"])
{
    ...
    editDetailsViewController.hidesBottomBarWhenPushed = YES;    // for hiding the TabBar
}

However, prepareForSegue is called before the push.

If you want the toolbar to hide with an animation you should implement a Custom UISegue and animate the UIToolbar in the transition.

Community
  • 1
  • 1
Nikola Kirev
  • 3,152
  • 3
  • 22
  • 30
  • Thanks Nikola, I assumed that the content of the `prepareForSegue` is called after the push. I'll try to follow the proposal of the added link. – JFS Jun 30 '13 at 12:36
  • Good luck! Keep in mind that the example in the link is about a completely different animation and in your case, you should figure out how to animate your toolbar. – Nikola Kirev Jun 30 '13 at 12:48
  • Yes I know. I'm still surprised that I need to implement a custom animation for that. – JFS Jun 30 '13 at 12:59
0

I think you should comment this line.

[self.navigationController setToolbarHidden:YES];

and try again.

xda1001
  • 2,449
  • 16
  • 18
  • Thanks looyao, I tried this before but this leads to an even worse looking behavior: the ToolBar is switched off and will leave its occupied space black in the tableView. in the detailsView the ToolBar appears very short and will disappear again. – JFS Jun 30 '13 at 12:41