LoginSignup
0
2

More than 3 years have passed since last update.

UIPageViewControllerのUIPageControlのサイズを変更する

Posted at

UIPageViewControllerのデフォルトでくっついてるUIPageControlのサイズを変更するときのTipsです。

UIPageControl自体のサイズを変更する方法

override open func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    for subV in self.view.subviews {
        if type(of: subV).description() == "UIPageControl" {
            subV.transform = CGAffineTransform(scaleX: 1.1, y: 1.1)// ここに指定する
        }
    }
}

UIPageControlのドットのサイズを変更する方法

override open func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    for subV in self.view.subviews {
        if type(of: subV).description() == "UIPageControl" {
            subV.subviews.forEach {
                $0.transform = CGAffineTransform(scaleX: 1.1, y: 1.1)
            }
        }
    }
}
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2