【发布时间】:2013-05-22 12:38:49
【问题描述】:
我有一个基于标签栏结合导航栏的应用。
在导航栏中,我有一个按钮,可以将我带到另一个我想隐藏标签栏的页面。当我试图通过一个按钮(不是返回栏按钮,常规按钮)返回主视图时,我无法将标签栏带回来。
我确实尝试过: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];
}
谢谢! 尤西
【问题讨论】:
-
为什么你没有为 FeedViewController 传递 nibname ??
-
这个类没有nib文件:)
标签: iphone objective-c uinavigationbar tabbar