Swift How to Show All Dots in PageControl

862 views Asked by At

I have 3 pages, but the dots viewed just 2

Hello, in this app i have 3 pages (index 0 - 2). But how the PageControl just show 2 pages? How can I show all dots of pages in my page control?

thank you :)

1

There are 1 answers

0
Quack E. Duck On BEST ANSWER

It appears from the GIF as if all three pages are present in your UIPageControl, but only the first two corresponding dots are actually being displayed.

To fix it, just add this:

pageControl.sizeToFit()

inside your view controller's viewDidLoad.

This will cause the page control to expand to display as many dots as pages exist.