iOS空心圆下载进度指示器控件
2024-10-09 22:08:56
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;
}
最新文章
- 2、C#面向对象:封装、继承、多态、String、集合、文件(上)
- .net开发笔记(十八) winform中的等待框
- ruby md5加签验签方法
- ECshop导入淘宝数据包乱码问题解决方法
- UIView的响应链
- Python 读写文件和file对象(转)
- BZOJ 4407 于神之怒加强版
- SQL SERVER 中 实现主表1行记录,子表多行记录 整合成一条虚拟列
- fullPage.js插件用法(转发)
- sqlserver 在将 nvarchar 值 'XXX' 转换成数据类型 int 时失败
- Bootstrap3写的红色警告框样式组件
- linux知识汇总
- github学习:如何从本地把项目上传到github&;&;如何把github项目通过clone复制下来,详细教程
- [转] vue&;webpack多页面配置
- Jfrog 与 jenkins Sonarqube的 测试样例 (From jfrog 培训)
- mac java jdk 安装删除
- 043 HIVE中的HQL操作
- ubuntu16系统磁盘空间/dev/vda1占用满的问题
- 【Selenium-WebDriver自学】WebDriver断言处理(十二)
- react设置innerHTML
热门文章
- POJ1743 Musical Theme [后缀数组]
- Salesforce开发者学习笔记之一:基本知识
- json
- [DS] 标记字段
- Mono 3.2.3 Socket功能迎来一稳定的版本
- Angular2学习笔记——NgModule
- Error on line -1 of document : Premature end of file. Nested exception: Premature end of file.
- ThinkPhp5.0模型验证规则
- 5.如何使主机和虚拟机IP处于同一网段(内网渗透专用)
- scheduleInRunLoop作用