博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[翻译] EAColourfulProgressView
阅读量:7091 次
发布时间:2019-06-28

本文共 1376 字,大约阅读时间需要 4 分钟。

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 改进

 

转载地址:http://svnql.baihongyu.com/

你可能感兴趣的文章
本贴给C++初学者一个学习参考
查看>>
以应用为中心的无服务器PaaS将成主流
查看>>
css reset
查看>>
命令注入写webshell
查看>>
特么的程序员励志故事(小IT职员在北京5年买了500W的房子)
查看>>
Apache配置文件的含义
查看>>
NTFS有什么用途
查看>>
全选和反选 checkbox
查看>>
socket函数介绍
查看>>
显示锚点(纵横显示菜单)
查看>>
iOS应用架构谈(二):View层的组织和调用方案(中)(转帖)
查看>>
splitview.js在newipad上不能正确显示问题解决
查看>>
重置SQL Server表中的自动编号ID为1
查看>>
PL/SQL Developer如何连接64位的Oracle图解
查看>>
如何使用sublime编辑器运行python程序
查看>>
haproxy配置文件的语法检查
查看>>
wget
查看>>
Java 二进制,八进制,十进制,十六进制相互转换
查看>>
Java面试题之十一 (转)
查看>>
13个mysql数据库的实用SQL小技巧
查看>>