标签:
//初始化UIPageControl
UIPageControl *pagecontrol=[[UIPageControl alloc]initWithFrame:CGRectMake(0, 50, 320, 20)];
//设置总页数
pagecontrol.numberOfPages=5;
//设置当前页数
pagecontrol.currentPage=3;
//添加事件
[pagecontrol addTarget:self action:@selector(change) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:pagecontrol];
标签:
原文地址:http://www.cnblogs.com/kyuubee/p/4804994.html