我有一个基于标签栏和导航栏的应用程序。在导航栏中,我有一个按钮,可以将我带到另一个我想隐藏标签栏的页面。当我试图通过一个按钮(不是返回栏按钮,常规按钮)返回主视图时,我无法将标签栏带回来。我确实尝试过: xxxxx.hidesBottomBarWhenPushed =NO;
这是我的一些代码:
在主视图中:
在viewDidLoad:
UIBarButtonItem *flipButton = [[UIBarButtonItem alloc]
initWithTitle:buttonTitle
style:UIBarButtonItemStylePlain
target:self
action:@selector(goToCreateEvent)];
-(void)goToCreateEvent{
UIViewController *targetViewController;
NSString *viewControllerName = @"CreateAnEventViewController";
targetViewController = [[NSClassFromString(viewControllerName) alloc] initWithNibName:viewControllerName bundle:nil];
targetViewController.hidesBottomBarWhenPushed =YES; //Hides the tab bar
[self.navigationController pushViewController:targetViewController animated:YES];
}
在另一个视图中:
-(IBAction)save:(id)sender
{
[summary resignFirstResponder];
[agenda resignFirstResponder];
FeedViewController *aboutViewCont = [[FeedViewController alloc] init];
aboutViewCont.hidesBottomBarWhenPushed =NO; //trying to bring back the tab bar
[[self navigationController] pushViewController:aboutViewCont animated:NO];
}
谢谢!约西