2012-02-07 50 views
0

我有一個ParentViewController這是在UIScrollView連同SiblingsViewControllers像下面的樹。iOS模式視圖控制器PageCurl動畫未顯示

  • RootViewController
    • UIScrollView
      • HomeViewController
      • ParentViewController
        • FormNotesViewController - 模態視圖使用頁面捲曲廣告素材
      • 被呈現
      • FooViewController
      • BarViewController

的ModalViewController由ParentViewController在IBAction爲帶有下面的功能。

- (IBAction)onNoteOpen:(id)sender { 
FormNotesViewController *notesView = [[FormNotesViewController alloc] initWithNibName:@"FormNotesViewController" bundle:nil]; 

//OPTION #1 
notesView.modalTransitionStyle = UIModalTransitionStylePartialCurl; 
notesView.modalPresentationStyle = UIModalPresentationFullScreen; 
[self presentModalViewController:notesView animated:YES]; 


//OPTION #2  
// [UIView beginAnimations:@"PartialPageCurlEffect" context:nil]; 
// [UIView setAnimationDuration:1.0]; 
// [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 
// [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp 
//       forView:notesView.view cache:NO]; 
// [self.view addSubview:notesView.view]; 
// [UIView commitAnimations]; 
} 

我已經嘗試了選項#1和#2。儘管它們都顯示了notesView,但應用程序未能顯示轉換。

我搞不​​明白爲什麼。

難道是因爲UIScrollView?難道是我錯過了什麼嗎?任何建議來調試這個?

+0

你檢查你的FormNotesViewControllers視圖幀財產?也許你必須等到viewDidLoad在你的筆記控制器中被調用。 – Dominik 2012-02-07 09:26:34

回答

0

選項1:

FormNotesViewController *notesView = [[FormNotesViewController alloc] initWithNibName:@"FormNotesViewController" bundle:nil]; 

notesView.modalTransitionStyle = UIModalTransitionStylePartialCurl; 

[self presentModalViewController:notesView animated:YES]; 

選項2:

[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:1.0]; 
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:notesView.view cache:YES]; 
[self.view addSubview:notesView.view]; 
[UIView commitAnimations]; 
+0

我必須使用不同的視圖結構來解決此問題。顯然,在UIScrollView中有很多視圖,並從UIScrollView的子視圖中調用FormNotesViewController與我遇到的問題有關。 我對視圖組織使用了不同的結構。 我很抱歉,因爲我不在項目中,所以我無法嘗試您提供的解決方案。不過謝謝。 – mmhan 2012-06-13 04:50:54

相關問題