有谁知道我为了将我自己的视图控制器手动添加到UIPageViewController方法而缺少什么? 我目前有这个,我不知道如何继续: NSDictionary *pageViewOptions = [NSDictionary dictionaryWithObjectsAndKeys:UIPageV
我目前有这个,我不知道如何继续:
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.
感谢所有喜欢提前帮助像我这样渴望新手的人….