我正在使用UIPageViewController來顯示嵌入子視圖控制器中的圖像。UIPageViewController子視圖控制器之間的水平填充
NSDictionary *options = [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger:UIPageViewControllerSpineLocationMin] forKey: UIPageViewControllerOptionSpineLocationKey];
self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options: options];
self.pageViewController.dataSource = self;
self.pageViewController.view.frame = self.view.bounds;
ImageViewController *initialViewController = [self viewControllerAtIndex:0];
initialViewController.index = 0;
NSArray *viewControllers = [NSArray arrayWithObject:initialViewController];
[self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
[self addChildViewController:self.pageViewController];
[self.view addSubview:self.pageViewController.view];
[self.pageViewController didMoveToParentViewController:self];
一切都很好,但我討厭子視圖控制器是緊挨着另一個。
我在想,如果有孩子視圖控制器之間添加填充物,這樣的方式他們不是旁邊彼此的方式。
東西會看起來更像這個: