简体   繁体   中英

Swift How to Show All Dots in PageControl

我有 3 页,但只查看了 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:)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM