UIPageControl
(1)继承
NSObject
UIResponder
UIView
UIControl
UIPageControl
从图中可以看出 UIPageControl继承了UIView、UIControl.它的作用是创建并且管理页的控制,一个 page control显示一系列的水平的点,每个点带表一页,当前看见的页的点是白色的。
(2)属性
管理页面导航
numberOfPages Property
hidesForSinglePage Property
currentPage Property
更新显示的page
pageIndicatorTintColor Property
currentPageIndicatorTintColor Property
defersCurrentPageDisplay Property
updateCurrentPageDisplay
Resizing the Control
- sizeForNumberOfPages:
使用
//UIPageController的配置
pageControlFirst=[[UIPageControl alloc]initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width/2-40, [UIScreen mainScreen].bounds.size.height-100, 80, 15)];
pageControlFirst.numberOfPages=4;
pageControlFirst.currentPage=0;
[pageControlFirst setBackgroundColor:[UIColor clearColor]];
[pageControlFirst setCurrentPageIndicatorTintColor:[UIColor redColor]];
pageControlFirst.pageIndicatorTintColor = [UIColor grayColor];
[self.view addSubview:pageControlFirst];