UITabBar is a top level view which means that almost all over views are underneath it. Even UINavigationController seats bellow tabBar.
You could hide tabBar like this:
- (void)hideTabBar:(UITabBarController *)tabbarcontroller withInterval:(NSTimeInterval)delay {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:delay];
for(UIView *view in tabbarcontroller.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y+50, 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+50)];
}
}
[UIView commitAnimations];
}
And then show it back on like this:
- (void)showTabBar:(UITabBarController *)tabbarcontroller withInterval:(NSTimeInterval)delay {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:delay];
for(UIView *view in tabbarcontroller.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y-50, 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-50)];
}
}
[UIView commitAnimations];
}
UITabBar is of height 50 px by default. So you just need to set new height to the frame and animate it.