0

I would like to change dot indicator to Segmented control. Is it possible? And how? I know that I can customize dots like this:

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

But I want it change for whole new control. If it isn't possible than what would be to best way to create same UIPageController with UIPageViewControllerTransitionStyleScroll but with Segmented control? Thanks

Libor Zapletal
  • 13,752
  • 20
  • 95
  • 182

1 Answers1

0

Here is a good solution available:

Is there a way to change page indicator dots color

Instead of creating UIPageControl object create GreyPageControl object. Other things are as it is.

Hope this helps.

Community
  • 1
  • 1
Mrunal
  • 13,982
  • 6
  • 52
  • 96
  • How to create custom UIPageControl it's clear and thanks for this. But I don't know how to use it with UIPageViewController. I don't create UIPageControl. It's created by using `self.pageController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];` and I can modify it in AppDelegate but just colors with code I shown in question. – Libor Zapletal Dec 11 '14 at 09:31
  • In the code you given in question you are using UIPageControl, so rather using that, use GreyPageControl – Mrunal Dec 11 '14 at 09:31
  • It's code that could change colors of UIPageControl but I just get it and I don't assign it to UIPageViewController. If I try `GrayPageControl *pageControl = [UIPageControl appearance];` it doesn't change anything. – Libor Zapletal Dec 11 '14 at 09:39
  • GrayPageControl *pageControl = [GrayPageControl appearance]; – Mrunal Dec 11 '14 at 09:40
  • It doesn't help. The example of code is like in this tutorial: http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/ in customize page indicator section. – Libor Zapletal Dec 11 '14 at 09:47