如何更改页面控制器点图像?

时间:2013-11-21 13:22:19

标签: ios uipagecontrol

我正在使用页面控制器,在我的滚动视图中添加了。页面控制器与我的Scroll View一起工作。但我需要在页面控制器的指示器上实现不同的图像(即页面控制器中出现的点)。这是所选指标的不同图像,页面控制器的未选择指标的图像不同。请帮忙。我在互联网上搜索了很多。试图找到第三方文件,但它们与指标的形状或颜色有关。请帮忙。

并且PLease添加了此页面的链接,在答案中,因为它不符合我的情况: Is there a way to change page indicator dots color

1 个答案:

答案 0 :(得分:1)

是的,您可以在页面控制中设置点的图像。以下代码适用于ios 6及以上版本。

    self.pageControl.pageIndicatorTintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"dot_inactive.png"]];

    self.pageControl.currentPageIndicatorTintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"dot_active.png"]];