2009-11-03 92 views
0

我有兩個視圖之間的UINavigationController動畫的小問題。 我的應用程序建立兩個以上視圖, 第一個視圖包含登錄信息,第二視圖包含根菜單,最後視圖包含樣本數據等等.. 我的MainWindow.xib包含一個UINavigationController組分,它是包含了所有的導航結構。 當我登錄查看裝入的,我使用的代碼UINavigationController動畫問題

- (void)viewWillAppear:(BOOL)animated { 
[self.navigationController setNavigationBarHidden:YES animated:NO]; 

}

此線隱藏UINavugationConttoller(我不需要在登錄過程中展現給用戶的導航欄。) 後,當用戶在登錄視圖上執行登錄提交按鈕 我使用此代碼將RootmenuView推送到UINavigationController的堆棧。

RootMenuController *rootMenuController = [[RootMenuController alloc] initWithNibName:@"RootMenuController" bundle:0]; 
[self.navigationController pushViewController:rootMenuController animated:NO]; 
[rootMenuController release]; 

它工作得很好。而當Rootmenuview加載的用戶必須顯示在導航欄上,然後我展示了UINavigation的工具欄使用此代碼

- (void)viewDidAppear:(BOOL)animated { 
[self.navigationController setNavigationBarHidden:NO animated:YES]; 

}

但我不喜歡的UINavigationController的默認的動畫過渡,然後我上面的代碼更改下面

[UIView beginAnimations:@"View Flip" context:nil]; 
[UIView setAnimationDuration:0.50]; 
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 

[UIView setAnimationTransition: 
UIViewAnimationTransitionFlipFromRight 
         forView:self.navigationController.view cache:YES]; 
RootMenuController *rootMenuController = [[RootMenuController alloc] initWithNibName:@"RootMenuController" bundle:0]; 
[self.navigationController pushViewController:rootMenuController animated:NO]; 

[UIView commitAnimations]; 

[rootMenuController release]; 

它的工作太多,但在兩個視圖naimation過渡之間的UINavigationController閃爍。

我沒有解決這個問題。

有什麼建議嗎?

謝謝

回答

2

您是否嘗試過[setAnimationTransition:forView:緩存:NO]?我得到了一些奇怪的行爲類似於你當我用惹的UIView動畫和使用的緩存左右。

+1

當改變緩存:是在我的看法轉變聲明NO,不閃爍。謝謝你refulgentis – fyasar 2009-11-03 22:36:24