2013-03-21 33 views
0

我创建了一个UINavigationBarButton在那里我已经放置在名为按钮显示“更新”。当更新按钮被点击它被导航到SecondViewController.But的问题是在SecondViewController的TabBar不显示。什么我想要做的是,当我点击在SecondViewController后退按钮应该回到RootViewController.Here是代码的TabBar后退按钮是不是在iOS应用

- (void)viewDidLoad { 
     [super viewDidLoad]; 
     [email protected]"GooGle"; 

     [self.navigationItem setLeftItemsSupplementBackButton:YES]; 
     [self.navigationController setToolbarHidden:NO]; 


     UIBarButtonItem *nextView = [[UIBarButtonItem alloc] initWithTitle:@"update" style:UIBarButtonSystemItemPlay target:self action:@selector(updateAddress)]; 
     self.navigationItem.rightBarButtonItem = nextView; 
     [nextView release]; 
} 

-(void)updateAddress 
{ 
     SecondViewController *updateView=[[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil]; 
     [self.navigationController presentViewController:updateView animated:YES completion:Nil]; 
     [self.navigationItem setLeftItemsSupplementBackButton:YES]; 
} 
+0

一次检查在一些SecondViewController类别的地方你都躲在一个我想是这样,但不知道。 – Balu 2013-03-21 09:16:26

+0

通过提供更多信息并使其更清晰来编辑您的问题。我无法理解什么是问题。 – Petar 2013-03-21 09:19:29

+0

@Sunny不是躲在SecondViewController.Just给出任何where.And没有推到RootViewController的SecondViewController – lreddy 2013-03-21 09:20:30

回答

2

当您点击在SecondViewController后退按钮使用

 [self dismissViewControllerAnimated:YES completion:nil]; 

由于您没有使用

 [self.navigationController pushViewController:youViewController animated:YES]; 

的导航栏将不可见,如果你这样做,你将有你的导航栏,并通过自身的同时后退按钮按下返回按钮,将自身移动到前视图

份额你的结果

+0

他正在谈论tabbar,而不是导航栏 – Petar 2013-03-21 09:26:37

+0

tabbarController? – 2013-03-21 09:28:24

+0

我想是的,这个问题是模棱两可的 – Petar 2013-03-21 09:31:02