I am developing an application in which I want to change either color or image of UIPageControl pagination dots. How can I change it? Is it possible to customize UIpageControl on above scenario?
I am developing an application in which I want to change either color or
Share
UPDATE:
This answer is 6 years old and very outdated, but it’s still attracting votes and comments. Ever since iOS 6.0 you should be using the
pageIndicatorTintColorandcurrentPageIndicatorTintColorproperties onUIPageControl.ORIGINAL ANSWER:
I ran into this problem today and decided to write my own simple replacement class.
It’s a sublassed UIView that uses Core Graphics to render the dots in the colors you specify.
You use the exposed properties to customize and control it.
If you want to you can register a delegate object to get notifications when the user taps on one of the little page dots. If no delegate is registered then the view will not react to touch input.
It’s completely fresh from the oven, but seems to work. Let me know if you run into any problems with it.
Future improvements:
bounds if there are too many.
Example use:
Header file:
Implementation file: