/***********************************************************************
* 方法名称:- (void)toShowToolBar
* 功能描述:显示工具栏
* 输入参数:
* 输出参数:
* 返 回 值:
* 其它说明:
***********************************************************************/
- (void)toShowToolBar //显示工具栏
{
for (UIView *subView in [tarbarController.view subviews])
{
if (![subView isKindOfClass:[UITabBar class]])
{
CGRect mFrame = subView.frame;
mFrame.size.height = subView.frame.size.height - tarbarController.tabBar.frame.size.height;
subView.frame = mFrame;
[tarbarController.view setHidden:NO];
}
else
{
[subView setHidden:NO];
}
}
return;
}
/***********************************************************************
* 方法名称:- (void)toHiddenToolBar
* 功能描述:隐藏工具栏
* 输入参数:
* 输出参数:
* 返 回 值:
* 其它说明:
***********************************************************************/
- (void)toHiddenToolBar //隐藏工具栏
{
for (UIView *subView in [tarbarController.view subviews])
{
if (![subView isKindOfClass:[UITabBar class]])
{
CGRect mFrame = subView.frame;
mFrame.size.height = subView.frame.size.height + tarbarController.tabBar.frame.size.height;
subView.frame = mFrame;
}
else
{
[subView setHidden:YES];
}
}
return;
}
放在appdelegate文件中,通过单例方法调用此两个方法。
注:tarbarController是UITabBarController创建的对象。