iOS 模态视图控制器 PageCurl 动画未显示
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
选项 1:
选项 2:
option 1:
option 2: