Iphone 按下时隐藏UITabBar,同时保持接触
我需要在一个视图控制器上隐藏Iphone 按下时隐藏UITabBar,同时保持接触,iphone,objective-c,ios,uitabbarcontroller,Iphone,Objective C,Ios,Uitabbarcontroller,我需要在一个视图控制器上隐藏uitabar。我试过了 vc.hideTabBarwhenpushed = TRUE 推的时候,;这很好,但是当我在这个视图控制器上打开一个UITable时,在uitabar应该在的底部,我的UITable没有接触到。 我试过了 [viewController setWantsFullScreenLayout:YES]; 但它不起作用。使用此代码隐藏和显示选项卡栏 //隐藏选项卡栏的步骤 - (void) hideTabBar:(UITabBarControll
uitabar
。我试过了
vc.hideTabBarwhenpushed = TRUE
推的时候,;这很好,但是当我在这个视图控制器上打开一个UITable
时,在uitabar
应该在的底部,我的UITable
没有接触到。
我试过了
[viewController setWantsFullScreenLayout:YES];
但它不起作用。使用此代码隐藏和显示选项卡栏 //隐藏选项卡栏的步骤
- (void) hideTabBar:(UITabBarController *) tabbarcontroller
{
[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, 480, view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
}
}
[UIView commitAnimations];
}
- (void) showTabBar:(UITabBarController *) tabbarcontroller
{
[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, 431, view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
}
}
[UIView commitAnimations];
}
//显示选项卡栏的步骤
- (void) hideTabBar:(UITabBarController *) tabbarcontroller
{
[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, 480, view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
}
}
[UIView commitAnimations];
}
- (void) showTabBar:(UITabBarController *) tabbarcontroller
{
[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, 431, view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
}
}
[UIView commitAnimations];
}
您需要确保正确设置了表视图的弹簧和支柱:
您使用的是
UITableViewController
?我需要检查其用户交互,iAppleit隐藏了选项卡栏,但我仍然无法接触到UITableView的UItabbar位置。。