[翻译] TSActivityIndicatorView 自定义指示器
TSActivityIndicatorView 自定义指示器
https://github.com/tomkowz/TSActivityIndicatorView
TSActivityIndicatorView
This is very simple view class that looks like an UIActivityIndicatorView but is fully customizable. Its 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 thats all. Look below.
对的,你可以在IB中使用它.你只需要在keyPath中传递图片的名字,thats 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都是在主线程中运行的哦.
什么是 SVG?本项目简单分享动画入门的相关知识,并附有相关代码演示,同时文档对SVG等相关内容有比较详细的叙述,如vector标签中属性所代表的意义解释、path标签所支持的指令解释等等。 什么是 SVG?本项目简单分享动画入门的相关知识,并附有相关代码演示,同时文档对SVG等相关内容有比较详细的叙述,如vector标签中属性所代表的意义解释、path标签所支持的指令解释等等。
相关文章
- Apache自定义日志格式
- ASP.NET 中验证的自定义返回和统一社会信用代码的内置验证实现
- 【Java 注解】自定义注解 ( 注解解析 )
- 【Android Gradle 插件】自定义 Gradle 任务 ② ( 在 Terminal 面板中执行 gradlew task 命令显示所有任务 | 命令行输出所有任务 | 单独执行指定任务 )
- WordPress 技巧:彻底关闭后台主题自定义功能
- WordPress 技巧:给 Admin Bar 添加自定义链接
- Typecho基础seo优化自定义文章描述与关键词
- Python 自定义模块导入详解编程语言
- [javaSE] 注解-自定义注解详解编程语言
- 由浅到深详细讲解JSP自定义标签详解编程语言
- 自定义一个类加载器详解编程语言
- MyBatis自定义TypeHandler处理枚举
- Jquery自定义动画概述及示例
- 自定义jquery模态窗口插件无法在顶层窗口显示问题
- Jquery基于Ajax方法自定义无刷新提交表单Form实例
- asp.net中c#自定义事件的实现方法详解