How to reposition points of PageViewController in Swift?

enter image description here

As you can see, my View image does not cover the entire screen. How can I make my imageView cover the whole screen and the dots are on the image?

I did this using viewController + PageViewController.

I resize it:

self.pageViewController.view.frame = CGRectMake(0, 0, self.view.frame.width, self.view.frame.size.height) 

My code is long, so if you want to see the exact part of my code, just ask about it

+5
source share
2 answers

If you need to show only images in your array, you can use UIScrollView to place all images.

After that you can use UIPageControl. Add UIPageControl to UIView.

Then, in the ScrollViewDidEndDecelerating method, by calculating the contentOffset of the UIScrollView, you can set the UIPageControl.

Hope this helps.

0
source

You can use the VC page delegate to know when a page has been resized, and refresh points.

0
source

All Articles