Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove the page indicator from UIPageViewController

I am using a page view controller in an iOs app. How do I remove the dots from this controller?

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.dontShowChecked = NO;
    self.imagesArray = @[  ..];

    self.textsArray = @[ ........
                        ];


    // Create page view controller
    self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"WTPageController"];
    self.pageViewController.dataSource = self;

    WTDetailViewController *startingViewController = [self viewControllerAtIndex:0];
    NSArray *viewControllers = @[startingViewController];
    [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

    // Change the size of page view controller
    CGFloat delta = [[PSDeviceInfo sharedInstance] is_iPhone] ? 50. : 50;

    self.pageViewController.view.frame = CGRectMake(0, 40., self.view.frame.size.width, self.view.frame.size.height - delta);
    [self.view addSubview:_pageViewController.view];
    [self.pageViewController didMoveToParentViewController:self];
}

The dots seem to add themselves automatically and are interfering with other UI elements in that area. How do i Remove them completely?

like image 681
user1028028 Avatar asked Aug 27 '14 18:08

user1028028


1 Answers

The dots are added once your UIPageViewController datasource implements the following methods:

presentationCountForPageViewController:
presentationIndexForPageViewController:

Avoid to implement those to get rid of the UIPageControl dots.

like image 129
Cornelius Avatar answered Sep 28 '22 21:09

Cornelius