Is there a way I can manipulate the parent view controller so that subviews are under UIPageControl?

I use horizontal scrolling in the application using the UIPageViewController, which I set for the navigation property to be Horizontal and the Transistor style to scroll. Everything works fine, I can add some sub-views that are presented correctly. I also want to use the built-in UIPageControl, which has a UIPageViewController, using these two methods:

-(NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController -(NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController 

This actually shows what I'm looking for: points that show which subview is being displayed. But, as you can see in the image, the UIPageControl is installed at the bottom of the parent view controller (UIPageViewController). You can imagine that this is not what I had in mind to introduce my UIPageControl. Is there a way I can manipulate the parent view controller so that subviews are under UIPageControl? Or is there any other good practice to achieve this? I know that I can implement horizontal scrolling using scrollView instead of the UIPageViewController, but that seems a lot more efficient to me.

http://i48.tinypic.com/2hd03ev.png

For clarity: the gray part is my view, and the red part is the underlying UIPageViewController that I use.

Thanks in advance for any answer!

+6
source share
1 answer

One solution would be to create and manage your own UIPageControl , rather than using the built-in UIPageControl .

If you created your own several parameters, they will be displayed at the desired depth, but I would recommend creating an overlay above the top of the UIPageViewController and adding a UIPageControl to this, so that the two are completely independent. You can also position the page control wherever you want.

To track page changes, run the UIPageViewControllerDelegate from the UIPageViewController and move the view controller changes to the UIPageControl using setCurrentPage and setNumberOfPages .

+4
source

All Articles