说说那些令人惊叹的下拉效果

1. 动画下拉,这里借用一下github的资源

优点:直接用gif图处理,下拉进度完全按照gif图运行时间,只要时间和下拉进度匹配就可以了, 效果很流畅

https://dribbble.com/shots/1418440-Twisted-gif?list=searches&tag=animated_gif&offset=3

这里有大堆gif资源可供下载参考

项目地址:https://github.com/uzysjung/UzysAnimatedGifPullToRefresh

2.矢量图处理

项目参考地址:https://github.com/nicolastinkl/TKRefereshTableHeaderView

优点:通过gpu渲染而成,效果可想而知。使用时调节矢量图比较麻烦

3. 最常见的圆圈进度填满之类的效果

这种就比较简单。 直接通过UIView -DrawRect即可实现

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 1.0);
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGFloat startAngle = -M_PI/;
CGFloat step = *M_PI/ * self.progress;
CGContextAddArc(context, self.bounds.size.width/, self.bounds.size.height/, self.bounds.size.width/-, startAngle, startAngle+step, );
CGContextStrokePath(context);
}

github地址:https://github.com/phaibin/EGOTableViewPullRefresh/blob/master/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/CircleView.m

ios PullToRefresh using animated GIF or image array or Vector image的更多相关文章

  1. C++中的数组array和vector,lambda表达式,C字符串加操作,C++中新类型数组(数组缓存),多元数组,new缓冲

     使用C++风格的数组.不须要管理内存. array要注意不要溢出,由于它是栈上开辟内存. array适用于不论什么类型 #include<iostream> #include< ...

  2. 【译】Rust中的array、vector和slice

    原文链接:https://hashrust.com/blog/arrays-vectors-and-slices-in-rust/ 原文标题:Arrays, vectors and slices in ...

  3. C++ 数组array与vector的比较

    转:http://blog.csdn.net/yukin_xue/article/details/7391897 1. array 定义的时候必须定义数组的元素个数;而vector 不需要: 且只能包 ...

  4. essential c++ 第一章 array及vector相关使用

    将对象初始化: 1.用等号(=)赋值运算符初始化,针对对象是内置类型或者对象可以单一值初始化 2.构造函数初始化,针对对象需要多个初始值的情况 单括号括住的字符表示字符常量(‘ ’): 第一个反斜线表 ...

  5. C++ Arrays, std::array, std::vector 总结

    原文来自: https://shendrick.net/Coding%20Tips/2015/03/15/cpparrayvsvector.html @Seth Hendrick Original a ...

  6. 使用Olami SDK 语音控制一个支持HomeKit的智能家居的iOS程序

    前言 HomeKit是苹果发布的智能家居平台.通过HomeKit组件,用户可以通过iphone.iPad和ipod Touch来控制智能灯泡,风扇.空调等支持HomeKit的智能家居,尤其是可以通过S ...

  7. 不通过App Store实现ios应用分发下载安装

    最近公司的项目准备着手宣传工作了,宣传手册上要印制App的下载地址二维码,但是客户端应用还未上线,需要一种临时的方案解决应用分发下载问题,通常ios应用必须通过苹果应用商店才能下载安装,但是也可以看到 ...

  8. 不通过App Store,在iOS设备上直接安装应用程序(转)

    今天在iOS设备上安装天翼云存储app,在safari上直接打开http://cloud.189.cn/wap/index.jsp,点击“点击免费安装”,如下图: 神奇的事情发生了,设备上直接下载ap ...

  9. [工作积累] 32bit to 64bit: array index underflow

    先贴一段C++标准(ISO/IEC 14882:2003): 5.2.1 Subscripting: 1 A postfix expression followed by an expression ...

随机推荐

  1. nmon for linux

    nmon(为Nigel's performance Monitor的简写) for linux工具是 IBM开源的在POWER, x86, x86_64, Mainframe & now AR ...

  2. 关于SQL\SQL Server的三值逻辑简析

    在SQL刚入门的时候,我们筛选为某列值为NULL的行,一般会采用如下的方式: SELECT * FROM Table AS T WHERE T.Col=NULL  www.2cto.com   而实际 ...

  3. 【CSS3】Advanced3:Universal, Child, and Adjacent Selectors

    1.Universal selectors eg:#target*{ } 2.Child selectors < something immediately nested within some ...

  4. 调试 Azure 云服务项目的方法

    调试 Azure 云服务项目 在菜单栏中选择“调试”>“启动调试”(键盘操作:F5). 重要提示 如果未将 Azure 云服务项目设置为启动项目,当你单击按钮以触发断点时,将出现以下错误:“外部 ...

  5. windows 7 下安装 IIS 和 ArcGis Server 9.3 遇到的问题及解决方法

    windows 7 下安装 IIS 和 ArcGis Server 9.3 遇到的问题及解决方法 分类: ArcGIS server 计算机2012-07-31 14:17 631人阅读 评论(0)  ...

  6. android ORMlite的应用

    ORMLite -轻量级的对象关系映射(ORM) 如果你需要在android中使用ORMLite 你需要进入官方网站http://ormlite.com/ 中下载 下载了这两个包以后,你还需要在对应的 ...

  7. mybatis generator 使用

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  8. HTTP POST发消息

    业务需求:模拟TANX给DSP发消息,protobuf数据已弄好. 代码: def PostDataToDSP(self,url,postdata): headers = { #taobao文档规定 ...

  9. 自己动手写缓存Version1

    实现一个最简单最主要的缓存系统. using System; using System.Data; using System.Configuration; using System.Web; usin ...

  10. vs自带服务测试工具

    在vs安装目录有一个vs自带的服务测试工具,地址为: "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Wcf ...