[翻译] SFRoundProgressCounterView 带有进度显示的倒计时视图
SFRoundProgressCounterView 带有进度显示的倒计时视图

https://github.com/simpliflow/SFRoundProgressCounterView
A custom UIView with a rounded progress bar and a counter in the center of the circle. Supports multiple time intervals (in milliseconds), start/stop/resuming counter, set custom color, etc. (see example project)
一个自定义的UIView,里面有一个圆形的进度条以及中央的一个计数器。支持多种时间格式(支持毫秒),开始,结束,恢复操作,以及自定义颜色。

Setup(开始)
Installing with CocoaPods
用CocoaPods安装
If you're unfamiliar with CocoaPods you can check out this tutorial here.
- In Terminal navigate to the root of your project.
- Run 'touch Podfile' to create the Podfile.
- Open the Podfile using 'open -e Podfile'
Add the pod
SFRoundProgressCounterViewto your Podfile.platform :ios, '7.0'
pod 'SFRoundProgressCounterView'
Run
pod install.- Open your app's
.xcworkspacefile to launch Xcode and start using the control!
Usage(使用)
- Either create SFRoundProgressCounterView by dragging UIView from storyboard and change implementing class or create it programmatically 创建SFRoundProgressCounterView
- Create an outlet (if create via storyboard) 创建 outlet
Set up time intervals 设置时间间隔
self.sfProgressCounterView.delegate = self;
NSNumber* interval = [NSNumber numberWithLong:5000.0];
self.sfProgressCounterView.intervals = @[interval];
// you could also define multiple intervals
//self.sfProgressCounterView.intervals = @[interval, interval, interval];
Counter interaction 设置计数器交互
[self.sfProgressCounterView start];
[self.sfProgressCounterView stop];
[self.sfProgressCounterView resume];
[self.sfProgressCounterView reset];
Appearance Settings 外观样式设置
// thickness of outer circle
self.sfProgressCounterView.outerCircleThickness = [NSNumber numberWithFloat:3.0]; // thickness of inner circle
self.sfProgressCounterView.innerCircleThickness = [NSNumber numberWithFloat:1.0]; // track color of outer circle
self.sfProgressCounterView.innerTrackColor = [UIColor redColor]; // track color of inner circle
self.sfProgressCounterView.outerTrackColor = [UIColor blackColor]; // distance between two circles (if multiple intervals)
self.sfProgressCounterView.circleDistance = [NSNumber numberWithFloat:6.0]; // set color of outer progress circles
self.sfProgressCounterView.outerProgressColor = color; // set color of inner progress circle
self.sfProgressCounterView.innerProgressColor = color; // set color of counter label
self.sfProgressCounterView.labelColor = color;
Delegate Methods(代理方法)
- (void)countdownDidEnd:(SFRoundProgressCounterView*)progressCounterView;
- (void)intervalDidEnd:(SFRoundProgressCounterView*)progressCounterView WithIntervalPosition:(int)position;
- (void)counter:(SFRoundProgressCounterView *)progressCounterView didReachValue:(unsigned long long)value;
Author(s)
[翻译] SFRoundProgressCounterView 带有进度显示的倒计时视图的更多相关文章
- [翻译] MCProgressView 使用自定义图片做进度显示
MCProgressView 使用自定义图片做进度显示 https://github.com/Baglan/MCProgressView Progress bar view with custom i ...
- html5 图片上传,支持图片预览、压缩、及进度显示,兼容IE6+及标准浏览器
以前写过上传组件,见 打造 html5 文件上传组件,实现进度显示及拖拽上传,兼容IE6+及其它标准浏览器,对付一般的上传没有问题,不过如果是上传图片,且需要预览的话,就力有不逮了,趁着闲暇时间,给上 ...
- 初识html5 File API实现带有进度提示的文件上传
Html5终于解决了上传文件的同时显示文件上传进度的老问题.现在大部分的网站用Flash去实现这一功能,还有一些网站继续采用Html <form>with enctype=multipar ...
- Xamarin iOS教程之进度条和滚动视图
Xamarin iOS教程之进度条和滚动视图 Xamarin iOS 进度条 进度条可以看到每一项任务现在的状态.例如在下载的应用程序中有进度条,用户可以很方便的看到当前程序下载了多少,还剩下多少.Q ...
- silverlight漂亮的文件上传进度显示原理及示例
silverlight漂亮的文件上传进度显示原理及示例 作者:chenxumi 出处:博客园 2009/11/27 13:37:11 阅读 1219 次 概述:在网站根目录web.config里配 ...
- Retrofit2文件上传下载及其进度显示
序 前面一篇文章介绍了Retrofit2的基本使用,这篇文章接着介绍使用Retrofit2实现文件上传和文件下载,以及上传下载过程中如何实现进度的显示. 文件上传 定义接口 1 2 3 @Multip ...
- [cocos2d]场景切换以及切换进度显示
本文主要分两个部分叙述,第一是场景切换,第二是场景切换的进度显示. 一.场景切换 参考learn-iphone-and-ipad-cocos2d-game-development 第五章内容 coco ...
- Python多线程同步命令行模拟进度显示
最近在一个Python(3.5)的小项目中需要用到多线程加快处理速度,同时需要显示进度,于是查了些资料找到几个实现方法:线程池的map-reduce和Queue结合线程的实现.这里简单的实例介绍一下Q ...
- nginx上传模块nginx_upload_module和nginx_uploadprogress_module模块进度显示,如何传递GET参数等。
ownload:http://www.grid.net.ru/nginx/download/nginx_upload_module-2.2.0.tar.gzconfigure and make : . ...
随机推荐
- JAVA封装消息中间件调用二(kafka消费者篇)
上一遍我简单介绍了kafka的生成者使用,调用方式比较简单,今天我给大家分享下封装kafka消费者,作为中间件,我们做的就是最大程度的解耦,使业务方接入我们依赖程度降到最低. 第一步,我们先配置一个消 ...
- Python+Selenium 自动化实现实例-获取测试对象的Css属性
#coding:utf-8 '''获取测试对象的css属性场景 当你的测试用例纠结细枝末节的时候,你就需要通过判断元素的css属性来验证你的操作是否达到了预期的效果.比如你可以通过判断页面上的标题字号 ...
- html学习-css
1.css初识 css 中文解释:层叠样式表,把html比作骨骼的话,css就是衣服,他的外在都能通过css来修饰,js则是肌肉,能使html动起来.产生用户交互... 1.1css样式表类型 css ...
- 0ra-12170 tns 连接超时
https://blog.csdn.net/zhaoxiangchong/article/details/8296980
- python ConfigParser 配置读写
我们写程序的时候一般都会写程序包的时候,很少硬编码写在一起,这有个很好的配置文件包. 参考 ConfigParser 和 ConfigParser 的使用 一.ConfigParser 简介 C ...
- 使用STL sort对字符串按字典序排序
使用string数组 #include<iostream> #include<string> #include<algorithm> using namespace ...
- CentOS 7安装Mysql并设置开机自启动的方法
CentOS 7不带Mysql数据库了,默认的数据库是MariaDB(Mysql的一个分支). 可以按照以下步骤手动安装Mysql数据库. 1. 下载rpm安装文件 ? 1 wget http://r ...
- python爬虫实战(三)--------搜狗微信文章(IP代理池和用户代理池设定----scrapy)
在学习scrapy爬虫框架中,肯定会涉及到IP代理池和User-Agent池的设定,规避网站的反爬. 这两天在看一个关于搜狗微信文章爬取的视频,里面有讲到ip代理池和用户代理池,在此结合自身的所了解的 ...
- STL容器 -- Set
核心: set 是一个数学含义上的集合-----保证了每个数的确定性, 互异性, 不仅如此, set 中的元素还是有序的. 头文件: #include <set> 拓展:由于 set 内的 ...
- NOIP2018游记(退役记。)
Noip2018游记 这可能是写的最后一篇博客? \(Day0\) 早上六点从学校出发? 早上有雾,在车上扯淡,睡觉. 莫名其妙到了中午,想着午饭怎么解决,后来才知道早上发的四个面包竟然就包括我的午饭 ...