3

我想在横向中显示另一个没有 Tabbar 的视图。所以我创建了一个新视图,只更改self.view

self.hidesBottomBarWhenPushed = YES;

但这对我不起作用。希望有人可以帮忙?

4

2 回答 2

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];
于 2012-12-12T11:56:01.500 回答
0

如果您不想推送导航控制器,请尝试以下代码:

UINavigationController *navAddEvent = [[UINavigationController alloc] initWithRootViewController:yourObg];

        navAddEvent.navigationBar.hidden = TRUE;

        [self presentModalViewController:navAddEvent animated:YES];
于 2012-12-12T11:56:21.097 回答