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

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. [Andrew]Ext.net Grid常用js

    var gridFunction= function (gridId) {                //获取当前Grid                var gridView = Ext.ge ...

  2. Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)解题报告

    对于这道水题本人觉得应该应用贪心算法来解这道题: 下面就贴出本人的代码吧: #include<cstdio> #include<iostream> using namespac ...

  3. bzoj 1879 [Sdoi2009]Bill的挑战(状压DP)

    Description  Input 本题包含多组数据. 第一行:一个整数T,表示数据的个数. 对于每组数据: 第一行:两个整数,N和K(含义如题目表述). 接下来N行:每行一个字符串. Output ...

  4. Codeforces149E - Martian Strings(KMP)

    题目大意 给定一个字符串T,接下来有n个字符串,对于每个字符串S,判断是否存在T[a-b]+T[c-d]=S(1 ≤ a ≤ b < c ≤ d ≤ length(T)) 题解 对于每个字符串S ...

  5. How to select a OptionSet on ms sqlserver database for Microsoft Dynamics CRM

    OptionSet: Select * from StringMap Global OptionSet: select  os.Name, l.Label from AttributePicklist ...

  6. 教程-delphi的开源json库:superobject,用法简介

    困惑一天的问题 一个语句搞定了... 回头细说. superobject中的{$DEFINE UNICODE} 就是它,这是json官方推荐的Delphi处理json的包,地址: http://www ...

  7. mongdb高级操作(group by )

    首先介绍哈方法 /** * 利用java驱动自带函数分组查询 * @param key 用来分组文档的字段 [group by key] * @param cond 执行过滤的条件 [where na ...

  8. Delphi- 调用存储过程的方法

    Delphi控件里拉一个TADOStoredProc,配置好相关链系,具体的操作列子如下: procedure TForm1.btnFirstClick(Sender: TObject); begin ...

  9. Android Fragment之间传值

    首先来介绍的是我们的默认的布局 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ...

  10. WindDbug应用

    Windbg是windows平台上的一款相当强大的调试工具,可以从msdn网站下载得到,最新版本包含在windows sdk中,默认会被安装在C:\Program Files\Debugging To ...