且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

UIPageViewController方向只有前进

更新时间:2023-02-12 22:37:55

当你的pageViewController将其过渡样式设置为滚动时,这是你得到的行为 - 我不知道为什么,但它与滚动有关视图被插入到某个层次结构中(如果我在启用了Instruments的情况下运行我的项目,我可以看到它被分配)。如果过渡是Page Curl,那么如果你的回报为零,你就不会显示任何前一页。

This is the behavior you get when your pageViewController has its transition style set to scroll -- I'm not sure why, but it has something to do with a scroll view being inserted into the hierarchy somewhere (which I could see being allocated if I ran my project with Instruments turned on). If the transition is Page Curl, then you don't get any previous page being displayed if your return nil where you do.

所以,我认为你被困在使用setViewControllers:direction:animated:completion:除非你想切换到Page Curl动画。

So, I think you're stuck with using setViewControllers:direction:animated:completion: unless you want to switch to the Page Curl animation.