当前位置 : 主页 > 手机开发 > ios >

ios5 – 如何在iOS 5中向UIPageViewController添加页面数组?

来源:互联网 收集:自由互联 发布时间:2021-06-11
有谁知道我为了将我自己的视图控制器手动添加到UIPageViewController方法而缺少什么? 我目前有这个,我不知道如何继续: NSDictionary *pageViewOptions = [NSDictionary dictionaryWithObjectsAndKeys:UIPageV
有谁知道我为了将我自己的视图控制器手动添加到UIPageViewController方法而缺少什么?

我目前有这个,我不知道如何继续:

NSDictionary *pageViewOptions = [NSDictionary dictionaryWithObjectsAndKeys:UIPageViewControllerOptionSpineLocationKey, [NSNumber numberWithInteger:UIPageViewControllerSpineLocationMin], nil];

self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:pageViewOptions];


BookViewController *pageOne = [self.storyboard instantiateViewControllerWithIdentifier:@"BookViewController"];

AnotherPage *pageTwo = [self.storyboard instantiateViewControllerWithIdentifier:@"AnotherPage"];

PageThree *pageThree = [self.storyboard instantiateViewControllerWithIdentifier:@"PageThree"];


self.pageViewController.delegate = self;
self.pageViewController.dataSource = self;

[self.pageViewController setViewControllers:[NSArray arrayWithObjects:pageOne, pageTwo, pageThree, nil] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

[self addChildViewController:self.pageViewController];

[self.view addSubview:self.pageViewController.view];

self.view.gestureRecognizers = self.pageViewController.gestureRecognizers;

[self.pageViewController didMoveToParentViewController:self];

但它似乎没有用.我只看到RootViewController.

感谢所有喜欢提前帮助像我这样渴望新手的人….

网友评论