Changing UIPageViewController own PageController regarding Color of Dots

前端 未结 3 701
梦毁少年i
梦毁少年i 2021-02-04 00:40

Hey I\'m using a UIPageViewController to control what page I am on and for scrolling. I know it\'s possible to show a Page Controller along with it by simply adding the followin

3条回答
  •  庸人自扰
    2021-02-04 01:28

    You can use UIAppearance to configure UIPageControl colors. This applies to UIPageControls in UIPageViewControllers too.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      UIPageControl *pageControl = [UIPageControl appearance];
      pageControl.pageIndicatorTintColor = [UIColor whiteColor];
      pageControl.currentPageIndicatorTintColor = [UIColor redColor];
    }
    

提交回复
热议问题