第一种方法:
在视图控制器的实例化被加入到导航控制器的栈容器之前,设置属性,相应的设置才会生效
self.hidesBottomBarWhenPushed = YES;
第二种方法:
在push的页面,通过改变标签栏控制器view的子view的frame的形式,来达到隐藏标签栏的效果
-(void)viewDidAppear:(BOOL)animated
{
NSArrary *views = self.tabBarController.view.subviews;
UIView *view1 = views[0];
UITabBar *view2 = (UITabBar *)views[1];
view1.frame = CGRectMake(0,0,320,480);
view2.frame = CGRectMake(0,480,320,49);
}
在返回的时候,需要还原tabbar
-(void)viewDidAppear:(BOOL)animated
{
NSArray *views = self.tabBarController.view.subviews;
UIView *view1 = views[0];
if(view1.frame.size.height > 431)
{
view1.frame = CGRectMake(0,0,320,431);
UITabBar *tabBar = (UITabBar *)views[1];
tabBar.frame = CGRectMake(0,431,320,49);
}
}
在视图控制器的实例化被加入到导航控制器的栈容器之前,设置属性,相应的设置才会生效
self.hidesBottomBarWhenPushed = YES;
第二种方法:
在push的页面,通过改变标签栏控制器view的子view的frame的形式,来达到隐藏标签栏的效果
-(void)viewDidAppear:(BOOL)animated
{
NSArrary *views = self.tabBarController.view.subviews;
UIView *view1 = views[0];
UITabBar *view2 = (UITabBar *)views[1];
view1.frame = CGRectMake(0,0,320,480);
view2.frame = CGRectMake(0,480,320,49);
}
在返回的时候,需要还原tabbar
-(void)viewDidAppear:(BOOL)animated
{
NSArray *views = self.tabBarController.view.subviews;
UIView *view1 = views[0];
if(view1.frame.size.height > 431)
{
view1.frame = CGRectMake(0,0,320,431);
UITabBar *tabBar = (UITabBar *)views[1];
tabBar.frame = CGRectMake(0,431,320,49);
}
}