UIPageControl 的默认样式是几个小圆点,系统没有提供属性供我们自定义这几个小圆点的样式,不过我们依然可以使用KVC来自定义PageControl的显示样式
UIPageControl *pageControl = [[UIPageControl alloc] init]; [pageControl setValue:[UIImage imageNamed:@"image1"] forKeyPath:@"_pageImage"]; [pageControl setValue:[UIImage imageNamed:@"image2"] forKeyPath:@"_currentPageImage"]; [self addSubview:pageControl]; self.pageControl = pageControl;