查看了UIPageControl的官方文档之后,发现它是有以下两个私有属性:
UIImage* _currentPageImage;
UIImage* _pageImage;
所以我们可以通过以下方法将UIPageControl的颜色进行修改,甚至也可以改为特殊图片
- (void) updateDots
{
NSArray *subView = pageControl.subviews;
for (int i =0; i < [subViewcount]; i++)
{
UIImageView *dot = [subViewobjectAtIndex:i];
dot.image = (self.currentPage == i ?imagePageStateHightlighted
: imagePageStateNormal);
}
}