用户登录
用户注册

分享至

iOS关于UIPageControl的基本属性

  • 作者: 秦綬
  • 来源: 51数据库
  • 2022-08-17
    //创建UIPageControl
    UIPageControl * page = [[UIPageControl alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height-50, self.view.bounds.size.width, 50)];
    
    //设置背景颜色
    page.backgroundColor = [UIColor clearColor];
    
    //设置小圆圈的个数
    page.numberOfPages = 15;
    
    //设置 小圆圈的颜色
    page.pageIndicatorTintColor = [UIColor orangeColor];
    
    //设置当前页的小圆圈颜色
    page.currentPageIndicatorTintColor = [UIColor redColor];
    
    //获取/更改当前页
    page.currentPage = 1;
    
    //增加点击事件
    [page addTarget:self action:@selector(pageClick:) forControlEvents:UIControlEventValueChanged];
软件
前端设计
程序设计
Java相关