我想在横向中显示没有Tabbar的另一个视图。
所以我创建了一个新视图,只更改了self.view
和
self.hidesBottomBarWhenPushed = YES;
但它对我不起作用。希望有人可以帮忙吗?
答案 0 :(得分:0)
只需在视图的viewWillAppear:
方法中添加此行即可隐藏UITabBar
[self.tabBarController.tabBar setHidden:YES];
并且将新视图设置为RootViewController只需使用下面的代码...
YourNewViewController *objView = [[YourNewViewController alloc] initWithNibName:@"YourNewViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:objView];
[self presentModalViewController:nav animated:YES];
答案 1 :(得分:0)
如果您不想推送navigationController,请尝试以下代码:
UINavigationController *navAddEvent = [[UINavigationController alloc] initWithRootViewController:yourObg];
navAddEvent.navigationBar.hidden = TRUE;
[self presentModalViewController:navAddEvent animated:YES];