【发布时间】:2012-01-24 01:35:18
【问题描述】:
我在我的应用程序中使用 UIPageViewController 和故事板。
在纵向时,我使用以下代码从一个页面跳转到另一个页面并且它工作正常。
int direction = UIPageViewControllerNavigationDirectionForward;
if ([self.modelController currentPage] < pagenum)
{
direction = UIPageViewControllerNavigationDirectionForward;
}
else if ([self.modelController currentPage] > pagenum)
{
direction = UIPageViewControllerNavigationDirectionReverse;
}
[self.pageViewController setViewControllers:[NSArray arrayWithObject:[self.modelController viewControllerAtIndex:pagenum storyboard:self.storyboard]] direction:direction animated:YES completion:NULL];
但是当我们处于横向模式时,相同的代码不起作用。横屏时如何翻页?
【问题讨论】:
-
我在我的应用程序中尝试了很多方法来实现这种卷曲效果,但我无法理解 UIPageViewController。你能和我分享一个简单的演示示例吗?
-
@CocoaMatters,我没有演示应用程序......但只需创建一个页面视图控制器项目,所有功能都已为您准备好。它也会生成演示页面
-
你能给我发邮件到 hiren.bhadreshwara@gmail.com 吗?
标签: ios storyboard uipageviewcontroller