有谁知道我为了手动将我自己的视图控制器添加到 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。
感谢所有喜欢帮助像我这样热心的新手的人,提前.... :)