0

How to remove bottom space of pageViewController?

enter image description here

so It can show the control icon on the image not on the black space..

Lion.k
  • 2,519
  • 8
  • 28
  • 43

1 Answers1

0

There are several solutions mentioned in this post! Here they are: Either switch the transition style from UIPageViewControllerTransitionStyleScroll to UIPageViewControllerTransitionStylePageCurl or implement the following code in the viewDidLoad:

NSArray *subviews = self.pageController.view.subviews;
UIPageControl *thisControl = nil;
for (int i=0; i<[subviews count]; i++) {
    if ([[subviews objectAtIndex:i] isKindOfClass:[UIPageControl class]]) {
        thisControl = (UIPageControl *)[subviews objectAtIndex:i];
    }
}

thisControl.hidden = true;
self.pageController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height+40);

It will automatically hide the pageControl indicator.

Community
  • 1
  • 1
Julius
  • 576
  • 5
  • 12