objective-cuipageviewcontrollerpagecontrol

objective-c UIPageViewController and PageControls


I'm creating UIPageViewController and overriding these functions:

 - (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController
 - (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController 

and it creates a PageControl here.

How can i change the style of PageContol? (default is white, but i need dark)


Solution

  • In the UIPageControl class reference (http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPageControl_Class/Reference/Reference.html), you can find two properties that will be of your interest: pageIndicatorTintColor and currentPageIndicatorTintColor.

    Change those two properties of you UIPageControl instance with UIColor you want, e.g. [UIColor blackColor] for dark color, etc.