TSActivityIndicatorView 自定义指示器

https://github.com/tomkowz/TSActivityIndicatorView

TSActivityIndicatorView

This is very simple view class that looks like an UIActivityIndicatorView but is fully customizable. It's great for you if you want to add indicator view to you game or app and it should be customized. If you use this class you can not only make circular Indicators, you can add images that are wide and have e.g. 3 rotating balls etc. (instead of one object which rotate in native UIActivityIndicator).

这是一个非常简单的view类,看起来像UIActivityIndicatorView并能完全的定制.如果你想定制UIActivityIndicatorView,那它非常有用.你还可以用图片来定制它哦.

Why should i use it?

As I mentioned earlier, if you want to have nice looking indicator view, use this class.

正如我说的那样,你想你的UIActivityIndicatorView好看点,就用这个类.

Is it better than animated UIImageView?

Yes. You can use it in very simple way in Interface Builder. You only have to pass images names in keyPath and that's all. Look below.

对的,你可以在IB中使用它.你只需要在keyPath中传递图片的名字,that's all.

How can i use it? Is it difficult?

There are two ways to use it and both are simple. Sounds good, ha?

有两种方式可以是哦那个,很简单滴.

Fully programically

First things first. You have to import class.

首先,你得先引入类.

#import "TSActivityIndicatorView.h"

Next thing to do is create instance.

然后,创建出实例对象.

    TSActivityIndicatorView *customIndicator =
[[TSActivityIndicatorView alloc] initWithFrame:CGRectMake(160-17, 100, 35, 35)];

Then you have to import images to your project and add titles to the frames property as an NSArray object.

之后,你需要将图片名赋值给NSArray即可.

    customIndicator.frames = @[@"activity-indicator-1",
@"activity-indicator-2",
@"activity-indicator-3",
@"activity-indicator-4",
@"activity-indicator-5",
@"activity-indicator-6"];

Next you may set duration time of whole animation.

然后,你设置下完整动画的时间.

    customIndicator.duration = 0.5f; /// Default is 1.0f

Penultimate step is to run this indicator.

倒数第二步是让他跑起来.

    [customIndicator startAnimating];

And after your things are done, stop indicator it by calling stopAnimating

等你的活干完了,让它停下来.

    [customIndicator stopAnimating];

Both startAnimating and stopAnimating methods are executed in Main Thread.

注意:startAnimating以及stopAnimating都是在主线程中运行的哦.

[翻译] TSActivityIndicatorView 自定义指示器的更多相关文章

  1. Android自定义指示器时间轴

    指示器时间轴在外卖.购物类的APP里会经常用到,效果大概就像下面这样,看了网上很多文章,大都是自己绘制,太麻烦,其实通过ListView就可以实现.   在Activity关联的布局文件activit ...

  2. 【翻译】自定义 UIViewController Transitions

    原文地址:http://www.shinobicontrols.com/blog/posts/2013/10/03/ios7-day-by-day-day-10-custom-uiviewcontro ...

  3. SAP CRM 自定义控制器与数据绑定

    当用户从视图离开时,视图将失去它的数据.解决这个问题,需要引入自定义控制器(Custom Controller)(译者注:SAP CRM自定义端中,不同地方的Custom Controller会翻译为 ...

  4. react-native-page-scrollview 的使用方法(实现酷炫的分页轮播效果,还支持自定义View)

    react-native-page-scrollview 对ScrollView的封装,可以很方便的实现水平,垂直分页轮播效果.而且可以自定义分页宽高,和侧边View的旋转,透明度,大小等. 对于原生 ...

  5. 掘金 Android 文章精选合集

    掘金 Android 文章精选合集 掘金官方 关注 2017.07.10 16:42* 字数 175276 阅读 50053评论 13喜欢 669 用两张图告诉你,为什么你的 App 会卡顿? - A ...

  6. servlet&jsp高级:第三部分

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  7. Orchard官方文档翻译(一) 总览

    原文地址:http://docs.orchardproject.net/ 最近想要学习了解orchard,但却没有找到相关的中文文档,只有英文文档.于是决定自行翻译,以便日后方便翻阅. 转载请注明原作 ...

  8. Flex4/Flash多文件上传(带进度条)实例分享

    要求 必备知识 本文要求基本了解 Adobe Flex编程知识和JAVA基础知识. 开发环境 MyEclipse10/Flash Builder4.6/Flash Player11及以上 演示地址 演 ...

  9. Android ExpandableListView的技巧和问题

    前言: 最近一个多月在认真的学习Android和做项目,文章内容表达的不好或者理解错了,希望大家评论指出. :-) 本文是总结几个比较常用且使用的技巧,和一个大家都会遇到的问题. 文章中大部分语句摘抄 ...

随机推荐

  1. csu 1551(线段树+DP)

    1551: Longest Increasing Subsequence Again Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: 267  Solve ...

  2. 解决 .net HttpClient 调用时出现的 "A task was cancelled" 错误

    近日在系统中集成ElasticClient客户端,自动创建索引.删除索引,发现通过 ElasticClient 的 LowerLevelClient 无法正确返回结果,但是索引已成功创建或删除. 并会 ...

  3. lr关联需要转义的常见字符

    转义字符总结     在做手动关联时,取边界值的时候,会经常用到转义字符,现将转义字符整理如下: \b 退格             \f 换页             \n 换行          ...

  4. python爬虫实战(四)--------豆瓣网的模拟登录(模拟登录和验证码的处理----scrapy)

    在利用scrapy框架爬各种网站时,一定会碰到某些网站是需要登录才能获取信息. 这两天也在学习怎么去模拟登录,通过自己码的代码和借鉴别人的项目,调试成功豆瓣的模拟登录,顺便处理了怎么自动化的处理验证码 ...

  5. Xamarin 2017.9.13发布更新

     Xamarin 2017.9.13发布更新 Visual Studio 2017更新到15.3.4.其中,Xamarin.Visual更新到4.6.3.4;Xamarin.iOS更新到10.12.3 ...

  6. 【BZOJ 4332】 4332: JSOI2012 分零食 (FFT+快速幂)

    4332: JSOI2012 分零食 Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 119  Solved: 66 Description 这里是欢乐 ...

  7. BZOJ3052 [wc2013] 糖果公园 【树上莫队】

    树上莫队和普通的序列莫队很像,我们把树进行dfs,然后存一个长度为2n的括号序列,就是一个点进去当作左括号,出来当作右括号,然后如果访问从u到v路径,我们可以转化成括号序列的区间,记录x进去的时候编号 ...

  8. 「ZJOI2009」多米诺骨牌

    「ZJOI2009」多米诺骨牌 题目描述 有一个n × m 的矩形表格,其中有一些位置有障碍.现在要在这个表格内 放一些1 × 2 或者2 × 1 的多米诺骨牌,使得任何两个多米诺骨牌没有重叠部分,任 ...

  9. SPOJ1557 GSS2

    不知道第几次回顾了,每次回顾感觉都有新的收获 这题YYZ认为非常的简单,我们一起去%%%她吧(洛谷$id: 54050$) 题面 给出$n$个数,有$q$个询问,求最大子段和,注意相同的数只算一次 做 ...

  10. [SDOI2015]约数个数和 --- 简单反演

    求\(\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{m}d(ij)\) 不知道怎么讲..... 首先考虑\(d(ij)\)究竟是什么 首先,很自然地想到,既然是求\( ...