-
创建UIPageControl对象.
@property(nonatomic,strong) UIPageControl *pageCtrl;
self.pageCtrl = [[UIPageControl alloc] initWithFrame:CGRectMake(x,y, w, h)];
-
设置页码的个数.
self.pageCtrl.numberOfPages = 10;
-
设置页码的颜色.
self.pageCtrl.pageIndicatorTintColor = [UIColor greenColor];
-
设置当前页码的颜色.
self.pageCtrl.currentPageIndicatorTintColor = [UIColor yellowColor];
-
将UIPageControl对象添加到视图.
[self.view insertSubview:self.pageCtrl aboveSubview:self.scrollView];
UIPageControl的使用
最新推荐文章于 2024-06-19 00:10:20 发布