4

Anyone has idea why setting color in pageIndicatorTintColor in UIPageControl does not work in iOS7? Here is the line of code where i set this property (self is UIPageControl):

[self setPageIndicatorTintColor:[UIColor greenColor]];

I checked in iOS Developer Library and description of this property seems to be same as was few weeks ago. Can it be deficiency of the Apple? Any idea how to fix it? However on iOS6 still works fine.

Neru
  • 679
  • 6
  • 19
  • please check this for a solution. – Neenu Sep 25 '13 at 08:31
  • Thanks to you I found DDPageControl which works pretty well. Unfortunatly I don't have a time to think whats Apple changed in UIPageControl. Instead of this I implemeted DDPageControl. Please set your post as a full answer and I will accept it. – Neru Sep 25 '13 at 13:40

2 Answers2

14

Had the same problem, fixed this by changing an order of methods, first of all you need to set numberOfPages and only after that tintColor's:

before:

UIPageControl *pageControl = [[UIPageControl alloc] initWithFrame: ...
pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
pageControl.pageIndicatorTintColor = [UIColor grayColor];
pageControl.numberOfPages = 5;

now:

UIPageControl *pageControl = [[UIPageControl alloc] initWithFrame: ...
pageControl.numberOfPages = 5;
pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
pageControl.pageIndicatorTintColor = [UIColor grayColor];
danylokos
  • 1,464
  • 15
  • 20
1

this is pretty idiotic: in my case alpha for that UIPageControl was 0.54 instead of 1.

Anton Tropashko
  • 5,486
  • 5
  • 41
  • 66