zoukankan      html  css  js  c++  java
  • UI<04>

    //声明对象
    @property (nonatomic,strong) UIPageControl *pagecontrol;
     
     //初始化
        self.pagecontrol = [[UIPageControl alloc] init];
        self.pagecontrol.backgroundColor = [UIColor greenColor];
          
        self.pagecontrol.frame = CGRectMake(0, 0, 100, 37);
        self.pagecontrol.center = CGPointMake(self.view.frame.size.width/2.0, self.view.frame.size.height/2.0);
        //总页数
        self.pagecontrol.numberOfPages = 5;
        //当前显示页
        self.pagecontrol.currentPage = 1;
        //其他页码指示器的颜色
        self.pagecontrol.pageIndicatorTintColor = [UIColor purpleColor];
        //当前页码指示器的颜色
        self.pagecontrol.currentPageIndicatorTintColor = [UIColor redColor];
        //只有一页时,是否隐藏页码指示器
        self.pagecontrol.hidesForSinglePage = YES;
        [self.view addSubview:self.pagecontrol];
       
        //添加事件
        [self.pagecontrol addTarget:self action:@selector(click:) forControlEvents:UIControlEventValueChanged];
       

  • 相关阅读:
    数据库之事务与常见故障
    数学的魅力 之 正多边形
    html5 的基础理解1
    android 引入开源项目
    android 图片查看器
    java 线程安全
    python3 自动生成requirement.txt
    centos 7 安装 python3.7
    python3 创建,激活虚拟环境
    Mac 配置poetry
  • 原文地址:https://www.cnblogs.com/iQingYang/p/6681144.html
Copyright © 2011-2022 走看看