In my app I have a screen that contains UIPageViewController. It takes part of the screen, so I've put it inside the container app.
To show the page controller I do the following
[self addChildViewController:self.pageController];
[self.pageContainerView addSubview:self.pageController.view];
In order to make page controller fit the container view's size, I've added constraints (using Pure Layout library)
- (void)updateViewConstraints {
[super updateViewConstraints];
if (!self.didUpdateConstraints) {
[self.pageContainerView addConstraints:[self.pageController.view autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsZero]];
self.didUpdateConstraints = YES;
}
}
Everything works fine here, except for 1 thing.
On the content controller (which is displayed inside page controller) I have an image view and 2 labels. Image view takes the whole screen, and labels overlay that image view.
My assumption was that in the page view controller, the image view would also take all the space of the container view and page indicator would be overlaying the image view.
In reality, page indicator is UNDER the image view. This way, the image view does not take the whole container's space, but is narrowed to place page indicator under it.
Is there a way to do it the way I want? I.e. Image view taking all the container's space and page indicator overlaying it.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire