0

如何从 中移除UITabBarControllerUIViewController当我们从一个移动UIViewController到另一个UIViewControllerUINavigationController

4

5 回答 5

0

您应该将UIViewController 的此属性设置为 YES:BOOL hidesBottomBarWhenPushed

示例: 下面代码的第二行是您所要求的。

UIViewController *destinationVC = [[UIViewController alloc] init];
[destinationVC setHidesBottomBarWhenPushed:YES]; // !!!
[self.navigationController pushViewController:destinationVC animated:YES];
于 2013-05-30T11:18:29.050 回答
0

覆盖代码中的 init 函数(loadView 可能不起作用

self.hidesBottomBarWhenPushed = NO;

// 或者,您可以通过将这些行放在 urself 命名的方法中,从应用程序委托中删除它

[mainMenuTabBarController.view removeFromSuperview];

于 2013-05-30T11:11:15.387 回答
-1
[self.tabBarcontroller.view removeFromSuperview];
[self.tabBarcontroller.tabbar removeFromSuperview];
于 2013-05-30T12:14:18.017 回答
-1
[self.tabBarcontroller.view removeFromSuperview];
于 2013-05-30T11:12:52.380 回答
-1
UIViewController *yourController = [[UIViewController alloc] init];
[yourController setHidesBottomBarWhenPushed:YES]; 
[self.navigationController pushViewController:yourController animated:YES];

在这里,您创建 ViewController 的实例,然后在推送它之前只需使用 setHidesBottomBarPushed() 以便在推送时隐藏它。

但请记住,只有在推动之前这样做,它才会起作用。

于 2013-05-31T05:40:31.913 回答