Check out the methods below, this is from stackoverflow and I failed to get the url of the answer/question.
#pragma mark - Hide/Show Tab Bar - (void)hideTabBar:(UITabBarController *)tabbarcontroller { [UIView animateWithDuration:0.5 animations:^{ for (UIView *view in tabbarcontroller.view.subviews) { if ([view isKindOfClass:[UITabBar class]]) { [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y+49.f, view.frame.size.width, view.frame.size.height)]; } else { [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, view.frame.size.height+49.f)]; } } } completion:^(BOOL finished) { //do smth after animation finishes tabbarcontroller.tabBar.hidden = YES; }]; } - (void)showTabBar:(UITabBarController *)tabbarcontroller { tabbarcontroller.tabBar.hidden = NO; [UIView animateWithDuration:0.5 animations:^{ for (UIView *view in tabbarcontroller.view.subviews) { if ([view isKindOfClass:[UITabBar class]]) { [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y-49.f, view.frame.size.width, view.frame.size.height)]; } else { [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, view.frame.size.height-49.f)]; } } } completion:^(BOOL finished) { //do smth after animation finishes }]; }
Post a Comment