如果我向前和向后滑动页面(图像),以下代码可以正常工作。 但是,我想知道怎么能从上到下或从下到上?
换句话说,当用户从上到下滑动时,图像将保留在屏幕的底部,然后第二个图像将会出现,依此类推。
self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageViewController"];
self.pageViewController.dataSource = self;
self.pageViewController.delegate = self;
PageContentViewController *startingViewController = [self viewControllerAtIndex:0];
NSArray *viewControllers = @[startingViewController];
[self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];