self.layer = [CAShapeLayer layer];
self.layer.frame = CGRectMake(, , , );
self.layer.position = self.view.center;
self.layer.lineWidth = 10.0;
self.layer.fillColor = [UIColor clearColor].CGColor;
self.layer.strokeColor = [UIColor lightGrayColor].CGColor;
self.layer.lineCap = kCALineCapSquare;
/*
CA_EXTERN NSString *const kCALineCapButt
__OSX_AVAILABLE_STARTING (__MAC_10_6, __IPHONE_3_0);
CA_EXTERN NSString *const kCALineCapRound
__OSX_AVAILABLE_STARTING (__MAC_10_6, __IPHONE_3_0);
CA_EXTERN NSString *const kCALineCapSquare
*/
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(, , , )];
self.layer.path = path.CGPath;
[self.view.layer addSublayer:self.layer]; self.layer.strokeEnd = 0.0;
_progress = ;
self.timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(updateProgress) userInfo:nil repeats:YES]; //更新下载进度
_progress += 0.01; if (self.layer.strokeEnd >= ) {
self.timer.fireDate = [NSDate distantFuture];
}
else
{
self.layer.strokeEnd = _progress;
}

最新文章

  1. 2、C#面向对象:封装、继承、多态、String、集合、文件(上)
  2. .net开发笔记(十八) winform中的等待框
  3. ruby md5加签验签方法
  4. ECshop导入淘宝数据包乱码问题解决方法
  5. UIView的响应链
  6. Python 读写文件和file对象(转)
  7. BZOJ 4407 于神之怒加强版
  8. SQL SERVER 中 实现主表1行记录,子表多行记录 整合成一条虚拟列
  9. fullPage.js插件用法(转发)
  10. sqlserver 在将 nvarchar 值 'XXX' 转换成数据类型 int 时失败
  11. Bootstrap3写的红色警告框样式组件
  12. linux知识汇总
  13. github学习:如何从本地把项目上传到github&&如何把github项目通过clone复制下来,详细教程
  14. [转] vue&webpack多页面配置
  15. Jfrog 与 jenkins Sonarqube的 测试样例 (From jfrog 培训)
  16. mac java jdk 安装删除
  17. 043 HIVE中的HQL操作
  18. ubuntu16系统磁盘空间/dev/vda1占用满的问题
  19. 【Selenium-WebDriver自学】WebDriver断言处理(十二)
  20. react设置innerHTML

热门文章

  1. POJ1743 Musical Theme [后缀数组]
  2. Salesforce开发者学习笔记之一:基本知识
  3. json
  4. [DS] 标记字段
  5. Mono 3.2.3 Socket功能迎来一稳定的版本
  6. Angular2学习笔记——NgModule
  7. Error on line -1 of document : Premature end of file. Nested exception: Premature end of file.
  8. ThinkPhp5.0模型验证规则
  9. 5.如何使主机和虚拟机IP处于同一网段(内网渗透专用)
  10. scheduleInRunLoop作用