[翻译] TSActivityIndicatorView 自定义指示器
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 自定义指示器的更多相关文章
- Android自定义指示器时间轴
指示器时间轴在外卖.购物类的APP里会经常用到,效果大概就像下面这样,看了网上很多文章,大都是自己绘制,太麻烦,其实通过ListView就可以实现. 在Activity关联的布局文件activit ...
- 【翻译】自定义 UIViewController Transitions
原文地址:http://www.shinobicontrols.com/blog/posts/2013/10/03/ios7-day-by-day-day-10-custom-uiviewcontro ...
- SAP CRM 自定义控制器与数据绑定
当用户从视图离开时,视图将失去它的数据.解决这个问题,需要引入自定义控制器(Custom Controller)(译者注:SAP CRM自定义端中,不同地方的Custom Controller会翻译为 ...
- react-native-page-scrollview 的使用方法(实现酷炫的分页轮播效果,还支持自定义View)
react-native-page-scrollview 对ScrollView的封装,可以很方便的实现水平,垂直分页轮播效果.而且可以自定义分页宽高,和侧边View的旋转,透明度,大小等. 对于原生 ...
- 掘金 Android 文章精选合集
掘金 Android 文章精选合集 掘金官方 关注 2017.07.10 16:42* 字数 175276 阅读 50053评论 13喜欢 669 用两张图告诉你,为什么你的 App 会卡顿? - A ...
- servlet&jsp高级:第三部分
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- Orchard官方文档翻译(一) 总览
原文地址:http://docs.orchardproject.net/ 最近想要学习了解orchard,但却没有找到相关的中文文档,只有英文文档.于是决定自行翻译,以便日后方便翻阅. 转载请注明原作 ...
- Flex4/Flash多文件上传(带进度条)实例分享
要求 必备知识 本文要求基本了解 Adobe Flex编程知识和JAVA基础知识. 开发环境 MyEclipse10/Flash Builder4.6/Flash Player11及以上 演示地址 演 ...
- Android ExpandableListView的技巧和问题
前言: 最近一个多月在认真的学习Android和做项目,文章内容表达的不好或者理解错了,希望大家评论指出. :-) 本文是总结几个比较常用且使用的技巧,和一个大家都会遇到的问题. 文章中大部分语句摘抄 ...
随机推荐
- Base64的好处
1. 昨天的<MIME笔记>中提到,MIME主要使用两种编码转换方式----Quoted-printable和Base64----将8位的非英语字符转化为7位的ASCII字符. 虽然这样的 ...
- rsync: chroot No such file or directory (2)
rsync: ) 查了N多资料,均未解决,最终发现是因为report后面多了个空格...
- SQL必知必会 -------- SELECT、注释
主要是看<SQL必知必会>第四版的书,而写的一些SQL笔记,红色的是方便以后查询的sql语句,工作中主要是使用mysql数据库,所以笔记也是围绕mysql而写的. 下文调试的数据表sql语 ...
- 113. 路径总和 II
给定一个二叉树和一个目标和,找到所有从根节点到叶子节点路径总和等于给定目标和的路径. 说明: 叶子节点是指没有子节点的节点. 示例:给定如下二叉树,以及目标和 sum = 22, 5 / \ 4 8 ...
- Prime Number CodeForces - 359C (属于是数论)
Simon has a prime number x and an array of non-negative integers a1, a2, ..., an. Simon loves fracti ...
- SPOJ1811 && SPOJ1812
SPOJ1811 && SPOJ1812 LCS && LCS2 非常神奇的两道题... 题目大意: 给定n个字符串,求最长公共子串 做法1: 后缀数组: 把字符串连起 ...
- NTFS ADS带来的web安全问题
有关ADS的简单说明请看http://www.xfocus.net/articles/200212/466.html 可以看到ADS在很久以前就被一些安全人员所关注,并且也提出了一些经典的利用,比如隐 ...
- [BZOJ5361]/[HDU6291]对称数
[BZOJ5361]/[HDU6291]对称数 题目大意: 一个\(n(n\le2\times10^5)\)个结点的树,每个结点有一个权值\(a_i(a_i\le2\times10^5)\),\(m( ...
- 某DP题目4
题意 有两个栈分别有n和m个数,每次从任意栈中取出一个数,令k为不同输出序列的总数,其中第i种输出序列的产生方式有ai个,求Σai2. n <= 500 分析 此题是关于ai2转换.咋一看此题好 ...
- python开发_textwrap文本样式
在看python的API的时候,发现python的textwrap在处理字符串样式的时候功能强大 在这里我做了一个demo: textwrap提供了一些方法: wrap(text, width = 7 ...