[翻译] 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和做项目,文章内容表达的不好或者理解错了,希望大家评论指出. :-) 本文是总结几个比较常用且使用的技巧,和一个大家都会遇到的问题. 文章中大部分语句摘抄 ...
随机推荐
- 编译报错:LC.exe 已退出
- linux下设置opencv环境变量
一.安装opencv(这里不再讲述) 二.添加库路径(创建opencv.conf文件) 输入命令:vi /etc/ld.so.conf.d/opencv.conf 输入/usr/local/lib,并 ...
- promise应用于ajax
promise应用于ajax,可以在本页打开控制台,复制代码试验 var url = 'https://www.cnblogs.com/mvc/blog/news.aspx?blogApp=dkplu ...
- MySQL增删改数据
1.增加数据 ,); /*插入所有字段.一定依次按顺序插入--字符串与日期需要加单引号,数字不需要,各个字段之间用逗号分隔*//*注意不能少或者多字段值*/ ,) /*按字段名插入数据,中间用逗号隔开 ...
- centos6.5挂载windows共享的文件夹
参考:http://www.centoscn.com/CentOS/Intermediate/2014/0318/2619.html http://www.ailab.cn/article/20150 ...
- 解析Excel
package com.jpcar.utils; import java.io.File; import java.io.FileInputStream; import java.io.IOExcep ...
- bzoj 1877 最小费用流
思路:挺裸的费用流,拆拆点就好啦. #include<bits/stdc++.h> #define LL long long #define fi first #define se sec ...
- 20179202《Linux内核原理与分析》第一周作业
实验一 Linux 系统简介 这一节主要学习了Linux的历史,重要人物以及学习Linux的方法.Linux和Windows在是否收费.软件与支持.安全性.可定制性和应用范畴等方面都存在着区别.目前感 ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)I - Piglet treasure hunt Series 1
题目描述 Once there was a pig, which was very fond of treasure hunting. The treasure hunt is risky, and ...
- Python并发编程-事件,红绿灯控制
事件用来控制多个进程同时执行或者阻塞 set和clear 分别用来修改一个事件的状态,True或者False is_set 用来查看一个事件的状态 wait 是依据事件的状态来决定自己是否在wait处 ...