iOS中的分页控件(UIPageControl)
2015-08-27 21:22
567 查看
#import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController - (void)viewDidLoad { [super viewDidLoad]; /** * UIPageControl 分页控件,提供以下几个功能: 1.展示当前总页数 2.展示当前是第几页 3.切换pageControl的当前显示的点对应显示不同的界面 */ //1.创建控件 UIPageControl *pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(20, 30, 260, 30)]; //2.配置属性 // pageControl.backgroundColor = [UIColor redColor]; //3.设置显示的总页数 pageControl.numberOfPages = 10; //4.设置点颜色 pageControl.pageIndicatorTintColor = [UIColor redColor]; //设置当前点的颜色 current 当前的意思 pageControl.currentPageIndicatorTintColor = [UIColor blueColor]; //设置默认的当前点 pageControl.currentPage = 5; //添加响应事件 [pageControl addTarget:self action:@selector(handlePageControl:) forControlEvents:UIControlEventValueChanged]; //3.添加到父视图 [self.view addSubview:pageControl]; //4.释放 [pageControl release]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma 点 - (void)handlePageControl:(UIPageControl *)pageControl { NSLog(@"%ld",pageControl.currentPage); }
相关文章推荐
- iOS中的UIScorllView(滑动控件,时机控制)的基本使用
- CircuitBreakingException[[FIELDDATA] Data too large, data for [proccessDate] would be larger than li
- STL中stack/queue/map以及Boost unordered_map 的使用方法
- UVa 1584 Circular Sequence
- iOS开发之有趣的UI —— 基础控件与经典案例
- 之前UI的小练习
- UI中的界面之间的值传递 <二>
- UIPickerView的属性和常用方法 举例:显示省份和城市
- JPA Query
- iOS中自定义UIView(用接口获取Lable和TextFile中的值)
- 版本欢迎页
- UITextfield控件的所有属性设置与解析
- iOS中的手势识别的积累:UIGestureRecognizer(轻拍手势,长按手势,清扫手势,平移手势,捏合手势,旋转手势,屏幕边缘平移手势) ----仿射变换
- Qt Quick分组属性案例
- Android UI 绘制过程浅析(三)layout过程
- UI中的界面之间的值传递 <一>
- UIView的各种方法介绍和生命周期
- SpannableStringBuilder 和 SpannableString
- iOS:UIPickerView选择器的使用
- ligerUI form表单里的filed的类型根据另外个filed的值改变而改变