iOS关于UIPageControl的基本属性

2014-11-28 0 641
iOS关于UIPageControl的基本属性
    //创建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];

遇见资源网 objective-c iOS关于UIPageControl的基本属性 http://www.ox520.com/15358.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务