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

发布于 2025-01-03 08:29:47 字数 1526 浏览 0 评论 0原文

我有一个 ParentViewController ,它位于 UIScrollView 及其 SiblingsViewControllers 中,如下图所示。

  • RootViewController
    • UIScrollView
      • HomeViewController
      • ParentViewController
        • FormNotesViewController - 使用 PageCurl 呈现的模态视图
      • 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 的原因吗?难道是我漏掉了什么?有什么调试建议吗?

I have a ParentViewController which is in a UIScrollView along with its SiblingsViewControllers like the tree below.

  • RootViewController
    • UIScrollView
      • HomeViewController
      • ParentViewController
        • FormNotesViewController - Modal view to be presented using PageCurl
      • FooViewController
      • BarViewController

The ModalViewController is presented by ParentViewController upon IBAction with a function below.

- (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];
}

I have tried both option #1 and #2. Though they both showed the notesView, the application fails to show the transition.

I can't figure out exactly why.

Could it be because of UIScrollView? Could it be that I missed something? Any advice to debug this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

無處可尋 2025-01-10 08:29:47

选项 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];

option 1:

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

notesView.modalTransitionStyle = UIModalTransitionStylePartialCurl;

[self presentModalViewController:notesView animated:YES];

option 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];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文