【发布时间】:2014-09-12 00:29:57
【问题描述】:
我有一个带有 3 个视图的 UIPageViewController。我想在按钮事件上从一个视图更改为另一个视图(类似于可以帮助您导航的 snapchat 按钮,即使滑动也可以完成这项工作)。我目前正在使用以下内容:
//the navWrapper is the view currently displayed
//it asks the PageViewController to set its view abruptly to the nextWrapper
[navWrapper.rootViewController.pageViewController setViewControllers:@[nextWrapper] direction:UIPageViewControllerNavigationDirectionReverse animated:NO completion:nil];
这很有效,因为它改变了正确显示的视图控制器,但我正在寻找一种方法来实现这种过渡就像滑动一样(而不是视图中的剧烈变化没有正在播放的动画)。
一直在四处寻找,但还没有弄清楚,感谢建议:)
【问题讨论】:
-
如果您想为过渡设置动画效果,请尝试使用 scrollView 而不是 PageView
-
如果你想要动画,为什么要为动画参数传递 NO?
标签: ios objective-c uipageviewcontroller transitions