Reduce dot size or padding to fit all page indicators on screen with UIPageControl

前端 未结 3 1278
醉话见心
醉话见心 2021-02-05 13:23

I have a UIPageControl that has 22 pages, therefore 22 page indicator dots. In landscape on iPhone they\'re all visible with plenty of space on the left and right,

3条回答
  •  暖寄归人
    2021-02-05 13:56

    If you have that many dots, I would seriously consider a different control. But if you want to stick to UIPageControl, I would just scale it down to fit on screen, with something like:

    pageControl.transform = CGAffineTransformMakeScale(0.7, 0.7);
    

    This scales it down to 70% of its initial size - I leave it to you to determine the best scale for your screen size/number of pages.

提交回复
热议问题