iosswiftuipagecontrolpagecontrol

Aligning page control


I have so many images in my page control that indicator dots are out of screen. Is there a way to align page control to left so that the dot related to first page will be visible on screen?

This is how it looks like now:

enter image description here

And this is what I want to achieve

enter image description here

I tried

imagesPageControl.contentMode = .Left
imagesPageControl.contentHorizontalAlignment = .Left

but without success. I have also tried to add some left constrain without right. I'm aware that on the right side page control will be still out of screen.


Solution

  • Scaling is an option if number of pages is constant or at least it has similar value. However, I ended up with manually adjusting the page control frame if it's width is greater than screen bounds.