UIPageControl

UIPageControl用于显示滑动视图实际拥有的页数

UIPageControl *page = [[UIPageControl alloc] initWithFrame:CGRectMake(100, 100, 100, 30);

page.background = [UIColor redColor];

page.numberOfPages = 5;  //设置拥有的页数

page.currentPage = 2; //设置当前显示第几个点

page.pageIndicatorTintColor = [UIColor redColor];  //设置当前选中的点的颜色.

[page addTarget:self action:@selector(handlePageControl:) forControlEvent:UIControlEventValueChanged]; //添加点击事件

原文地址:https://www.cnblogs.com/lion-witcher/p/5095195.html