Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何从UIViewController中删除UIAbbarController_Iphone_Ios_Uiviewcontroller_Uinavigationcontroller_Uitabbarcontroller - Fatal编程技术网

Iphone 如何从UIViewController中删除UIAbbarController

Iphone 如何从UIViewController中删除UIAbbarController,iphone,ios,uiviewcontroller,uinavigationcontroller,uitabbarcontroller,Iphone,Ios,Uiviewcontroller,Uinavigationcontroller,Uitabbarcontroller,当我们使用UINavigationController从一个UIViewController移动到另一个UIViewController时,如何从UIViewController中删除uitabarcontroller 覆盖代码中的init函数(loadView可能无法工作) //或者,您可以通过将这些行放在名为urself的方法中,将其从app delegate中删除 [mainMenuTabBarController.view从SuperView移除] 您应该将UIViewControlle

当我们使用
UINavigationController
从一个
UIViewController
移动到另一个
UIViewController
时,如何从
UIViewController
中删除
uitabarcontroller

覆盖代码中的init函数(loadView可能无法工作

//或者,您可以通过将这些行放在名为urself的方法中,将其从app delegate中删除

[mainMenuTabBarController.view从SuperView移除]

您应该将UIViewController设置为YES:
BOOL hidesbottombarwhenpush

[self.tabBarcontroller.view removeFromSuperview];
例如: 下面代码的第二行是您要问的

UIViewController *destinationVC = [[UIViewController alloc] init];
[destinationVC setHidesBottomBarWhenPushed:YES]; // !!!
[self.navigationController pushViewController:destinationVC animated:YES];
这里创建ViewController的一个实例,然后在推送它之前,只需使用setHidesBottomBarPushed(),以便在推送它时隐藏它


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

请在提问时更详细。你的意思是隐藏tabbar吗?
UIViewController *destinationVC = [[UIViewController alloc] init];
[destinationVC setHidesBottomBarWhenPushed:YES]; // !!!
[self.navigationController pushViewController:destinationVC animated:YES];
[self.tabBarcontroller.view removeFromSuperview];
[self.tabBarcontroller.tabbar removeFromSuperview];
UIViewController *yourController = [[UIViewController alloc] init];
[yourController setHidesBottomBarWhenPushed:YES]; 
[self.navigationController pushViewController:yourController animated:YES];