2013-03-21 32 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