Increase the size of the indicator in UIPageViewController's UIPageControl

前端 未结 6 1974
予麋鹿
予麋鹿 2020-12-08 02:47

Is it possible to Increase the size of the indicator in UIPageViewController?

I have this:

And my requirement is this:

6条回答
  •  时光说笑
    2020-12-08 03:26

    Swift 4, 4.2 and 5

    First create an outlet of page control

    @IBOutlet weak var pageControl: UIPageControl!
    

    If you want to keep the original spacing.

    override func viewDidLayoutSubviews() {
            pageControl.transform = CGAffineTransform(scaleX: 2, y: 2)
    }
    

    If you don't want to keep the original spacing.

    override func viewDidLayoutSubviews() {
            pageControl.subviews.forEach {
                $0.transform = CGAffineTransform(scaleX: 2, y: 2)
            }
    }
    

提交回复
热议问题