異なるView Controllerから複数回タブバーを表示および非表示にしたい場合は、appDelegate.mファイルに以下のコードを実装してください
- (void) hideTabBar:(UITabBarController *) tabbarcontroller
{
int height = 480;
if (([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight)
|| ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft))
{
height = 320;
}
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
for(UIView *view in tabbarcontroller.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, height, view.frame.size.width, view.frame.size.height)];
}
else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, height)];
}
}
[UIView commitAnimations];
}
-(void) showTabBar:(UITabBarController *) tabbarcontroller
{
int height = 431;
if (([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight)
|| ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft))
{
height = 271;
}
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
for(UIView *view in tabbarcontroller.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, height, view.frame.size.width, view.frame.size.height)];
}
else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, height)];
}
}
[UIView commitAnimations];
}