2011-03-31 59 views
0

好吧,正在處理帶有tabbar的視圖和另一個視圖之間的過渡,這是一個信息/關於視圖。我有代碼從視圖切換到tabbar並轉換回前一個視圖,但在轉換過程中,我丟失了底部的tabbar。不知道到底如何與在MainWindow.xib中在uimodaltransition期間丟失了tabbar

例如使用TabBar接近這個:

  • (IBAction爲)backButtonPressed:(ID)發送 { TablesViewController * TVC = [[TablesViewController頁頭] initWithNibName :@「TablesView」bundle:nil];

    tvc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:tvc animated:YES]; [tvc release];

}

感謝, NP

回答

1

嘗試從呈現的的UITabBarController含有實例的模式過渡,而不是UIViewController的動作是從觸發。

- (IBAction)backButtonPressed:(id)sender 
{ 
    TablesViewController *tvc = [[TablesViewController alloc] initWithNibName:@"TablesView" bundle:nil; 
    tvc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
    [self.tabBarController presentModalViewController:tvc animated:YES]; 
    [tvc release]; 
} 
+0

不知道如果我完全明白如何做到這一點。我有在程序的appDelegate中聲明的UITabBarController? – user686695 2011-04-01 01:47:37

+0

調用UIViewController應該自動引用它的UITabBarController ...我提供的代碼應該按原樣工作。 – 2011-04-01 03:05:57

+0

嘿,試了一下,它現在不會過渡回來? – user686695 2011-04-01 03:44:09

0

我有完全相同的問題,做了一個醜陋的解決方案:

- (IBAction)backButtonPressed:(id)sender { 
[self.navigationController dismissModalViewControllerAnimated:YES]; 
}