iOS模态视图控制器PageCurl动画未显示

时间:2012-02-07 07:51:12

标签: ios ios5 modalviewcontroller presentmodalviewcontroller

我的ParentViewControllerUIScrollViewSiblingsViewControllers一样,位于RootViewController

  • UIScrollView
    • HomeViewController
      • ParentViewController
      • FormNotesViewController
        • FooViewController - 使用PageCurl呈现的模态视图
      • BarViewController
      • ParentViewController

ModalViewController由- (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]; } 在IBAction上呈现,其功能如下。

notesView

我尝试了#1和#2选项。虽然它们都显示UIScrollView,但应用程序无法显示转换。

我无法弄明白为什么。

可能是因为{{1}}吗?可能是我错过了什么吗?有什么建议可以调试吗?

1 个答案:

答案 0 :(得分: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];