EAColourfulProgressView

效果:

EAColourfulProgressView is a custom progress view where the current filling colour is generated between two colours, based on the current value.

It takes advantages of IBDesignable and IBInspectable so that you can completely customize with without leaving the Interface Builder:

EAColourfulProgressView是一个定制的进度条view,其进度当中的颜色介于两个颜色之间,当前颜色值由当前值决定。

它使用了IBDesignable与IBInspectable,所以,你可以完全的定制他,不用IB也行:

It gives you the possibility to update the current value by calling:

你可以使用如下的方法来实时更新颜色值:

/**
* This method updates the current value to the given one. It can
* animate the progress view filling size, as well as the background
* color change, if 'animated' is YES.
*
* @param currentValue The new current value to be used.
* @param animated BOOL with YES if the update should be animated, NO otherwise.
*/
- (void)updateToCurrentValue:(NSInteger)currentValue animated:(BOOL)animated;

Installation Cocoapods

Add this in your Podfile

pod 'EAColourfulProgressView', '~> 0.1.0'

Usage

Set the Custom Class of a UIView to EAColourfulProgressView in Interface Builder, customize the available variables and see them being live rendered ;)

在IB中,你将UIVIew的子类设置成EAColourfulProgressView,定制一下属性,然后就会像上图中显示的那样子了:)

Future improvements

  • Any number of segments 任意数量的分段显示
  • Segment separators (loading like progress view) 分段显示风格(看起来像真正的进度条)
  • Performance improvements 改进

[翻译] EAColourfulProgressView的更多相关文章

  1. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  2. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  3. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  4. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  5. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  6. 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...

  7. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  8. 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?

    0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

随机推荐

  1. hibernate_SessionFactory_getCurrentSession_JTA简介

    JTA:java transaction  api java里所规定的一种管理事务的API 在另一篇播客我写到了,SessionFactory需要关注两个方法, 即:  openSession     ...

  2. ubuntu下安装h2数据库

    1.下载h2数据库安装包 http://www.h2database.com/html/download.html 2.解压安装文件包到指定目录 3.运行sh文件 4.访问web地址: http:// ...

  3. JVM-垃圾收集过程的内存管理

    JDK1.7 JVM的垃圾收集算法有 1. 标记-清除算法: 2. 复制算法:在商业虚拟机都是使用这种算法来回收新生代的 3. 标记-整理算法: 4.分代收集算法: JDK1.7 JVM的垃圾收集器有 ...

  4. PHP之mb_strrpos使用

    mb_strrpos (PHP 4 >= 4.0.6, PHP 5, PHP 7) mb_strrpos - Find position of last occurrence of a stri ...

  5. ListenableFuture in Guava

    ListenableFuture的说明 并发编程是一个难题,但是一个强大而简单的抽象可以显著的简化并发的编写.出于这样的考虑,Guava 定义了 ListenableFuture接口并继承了JDK c ...

  6. fgets()函数读取键盘,去掉换行符或丢弃多余的字符

    在上一遍随笔中,我们知道可以用fgets()函数来代替不安全的gets()函数.fgets函数中的第二个参数限制了读取的个数. 上篇文章也提到,fgets是会读取回车换行符的.有时候我们并不希望在字符 ...

  7. Bootboxjs快速制作Bootstrap的弹出框效果

    Bootboxjs是一个简单的js库,简单快捷帮你制作一个Bootstrap的弹出框效果. 一.简介 bootbox.js是一个小的JavaScript库,它帮助您在使用bootstrap框架的时候快 ...

  8. Vue2.0项目实战语法

    一.安装配置依赖 1) vue init webpack-simple 项目名称 2) cnpm install 3 )  npm run dev 4 )  cnpm install vuex vue ...

  9. Yii2:记一次尴尬的bug

    创建一个文章模块,写完添加动作之后,分配到视图,发现报错: Exception (Not Supported) 'yii\base\NotSupportedException' with messag ...

  10. CSS级联样式表-css选择器

    CSS概念 Cascading Style sheet 级联样式表 表现HTMl或XHTML文件样式的计算机语言 包括对字体,颜色,边距,高度,宽度,背景图片,网页定位等设定 建议:把表示样式的代码从 ...