UIPageControl
1. numberOfPages // 设置有多少页 默认为0
[pageControl setNumberOfPages:kImageCount];
2. currentPage // 设置当前页
[pageControl setCurrentPage:0];
3. pageIndicatorTintColor // 设置页码指示器颜色
[pageControl setPageIndicatorTintColor:[UIColor blackColor]];
4. currentPageIndicatorTintColor // 设置当前页码指示器颜色
[pageControl setCurrentPageIndicatorTintColor:[UIColor redColor]];
5. 添加分页控件的监听事件(监听值改变事件)
[pageControl addTarget:self action:@selector(pageChanged:) forControlEvents:UIControlEventValueChanged];
效果: