UIPageControl
来源:互联网 发布:宏杰软件 编辑:程序博客网 时间:2024/05/16 04:34
self.pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(0, 0, 275, 30)]; _pageControl.center = CGPointMake(375 / 2, 667 - 100); self.view.backgroundColor = [UIColor whiteColor]; //设置当前点的颜色 _pageControl.currentPageIndicatorTintColor = [UIColor purpleColor]; //设置其他点颜色 _pageControl.pageIndicatorTintColor = [UIColor lightGrayColor]; //设置点的个数 _pageControl.numberOfPages = 6; //设置当前点的位置 _pageControl.currentPage = 0; //添加事件 [_pageControl addTarget:self action:@selector(pageControlAction:) forControlEvents:UIControlEventValueChanged];#pragma mark - 点击事件-(void)pageControlAction:(UIPageControl *)pageControl{ NSLog(@"%ld",pageControl.currentPage); //设置scrollView的偏移量 _scrollView.contentOffset = CGPointMake(375 * pageControl.currentPage, 0); }-(void)tapAction:(UITapGestureRecognizer *)tap{ UIAlertView *alerView = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"欢迎使用" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确认", nil]; [alerView show]; [alerView release]; [self.scrollView removeFromSuperview]; [self.pageControl removeFromSuperview];}//将要减速-(void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{ _pageControl.currentPage = scrollView.contentOffset.x / 375;}//停止-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ _pageControl.currentPage = scrollView.contentOffset.x / 375;}
0 0
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- UIPageControl
- Camora调用系统的照相机和相册以及图片的压缩
- 关于多个spinner联动
- delphi编译选项
- 成为腾讯开发者——如何使用QQ开放平台和微信开放平台
- Ember copy array
- UIPageControl
- (转)C语言union(联合体 共用体)
- 分析黑盒测试
- Oracle冷备步骤
- Android项目导入jar包——Android查看Jar包的源码——配置
- HDOJ 1005 Number Sequence
- 在Mac OSX下安装和使用GO语言
- C++Primer第五版 7.5.4节练习
- Android下载任务队列实现