我正在使用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];
一切都很好,但我讨厌子视图控制器彼此挨着。
我想知道是否有一种方法可以在子视图控制器之间添加填充,以便它们不会挨在一起。
类似这样的效果:
UIPageViewControllerOptionInterPageSpacingKey
has changed toUIPageViewController.OptionsKey.interPageSpacing
- Peterses