关于如何隐藏UITabbar的问题,曾经困扰过很多人。

1,设为Hidden, 这种方法虽然将TabBar隐藏掉,但是下面是一片空白,没有起到隐藏的实际功效

2,设置tabbar.frame = CGRectMake(0,480+);既将tabbar的frame 降低到屏幕一下。 这种方法也不行。

 

其实iphone SDK里面有一个参数,可以直接隐藏掉UITabBar:

 

UIViewCtrlTest* testCtrl = [[UIViewCtrlTest alloc] initW];
			threeModalView.hidesBottomBarWhenPushed = YES;
			[self.navigationController pushViewController:testCtrl animated:YES];
                        threeModalView.hidesBottomBarWhenPushed = NO;//马上设置回NO
			[testCtrl release];

 

 

不过使用该参数,虽然可以成功隐藏TabBar,但是popup回来的时候,有可能Tababr没有再出现, 既用户一旦隐藏,就无法重现了。

这个问题,有人建议在viewWillAppear 和 viewWillDisAppear里面设置

hidesBottomBarWhenPushed为TRUE 和 FALSE。

我自己的做法是:
                       UIViewCtrlTest* testCtrl = [[UIViewCtrlTest alloc] initW];
			testCtrl.hidesBottomBarWhenPushed = YES;
			[self.navigationController pushViewController:testCtrl animated:YES];
                        testCtrl.hidesBottomBarWhenPushed = NO;//马上设置回NO
			[testCtrl release];

相关文章:

  • 2022-12-23
  • 2021-12-24
  • 2021-11-09
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 1970-01-01
猜你喜欢
  • 2021-11-03
  • 2021-08-18
  • 2021-10-24
  • 2022-02-12
  • 2022-12-23
  • 2022-01-18
  • 2021-05-22
相关资源
相似解决方案