Reputation: 718
I have a customized tabbar in my app. I want to hide my tabbar when pushing another viewcontroller. Currently I implemented as this(The original tabbar has been hidden):
myViewController.hidesBottomBarWhenPushed = YES;
((CustomTabBarController *)self.tabBarController).customTabBar.hidden = YES;
[self.navigationController pushViewController:lookBookViewController animated:YES];
But when it is being pushed, it hides my customTabBar immediately. So you can see a black bottom bar in first viewcontroller. Is there a way to fix this problem?
Thanks.
Upvotes: 1
Views: 1764
Reputation: 4731
put your these code in - (void)viewDidDisappear:(BOOL)animated;
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
myViewController.hidesBottomBarWhenPushed = YES;
((CustomTabBarController *)self.tabBarController).customTabBar.hidden = YES;
}
you can design like this
and then you need not to hide the tabbar , if you want to hide it , you can use my above code , I think if you design like this , the hide effect will be you want
Upvotes: 1