JTBorderDotAnimation

https://github.com/jonathantribouharet/JTBorderDotAnimation

JTBorderDotAnimation is a simple animation for have dots turning around a UIView on iOS.

JTBorderDotAnimation是一个很简单的动画效果,用于给UIView添加点的循环移动特效.

Installation - 安装

With CocoaPods, add this line to your Podfile.

使用 CocoaPods ,添加以下一行代码即可.

pod 'JTBorderDotAnimation', '~> 1.0'

Screenshots - 屏幕截图

Usage - 使用

Basic usage 基本使用

Just import JTBorderDotAnimation.h.

只需要引入头文件 JTBorderDotAnimation.h 即可.

#import "JTBorderDotAnimation.h"

@interface ViewController : UIViewController

@property (weak, nonatomic) IBOutlet UIView *animatedView;

@property (strong, nonatomic) JTBorderDotAnimation *dotAnimation;

@end

Assign the view you want to animate and start the animation.

给你想要做动画的view添加上,然后开始执行动画.

- (void)viewDidLoad
{
[super viewDidLoad]; self.dotAnimation = [JTBorderDotAnimation new];
self.dotAnimation.animatedView = self.animatedView;
} - (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated]; [self.dotAnimation start];
}

Customization 可以定制的特性

You can easily customize the animation.

你可以很容易的定制以下的一些和动画相关的属性.

  • numberPoints
  • duration
  • repeatCount
  • pointSize
  • pointColor

Example:

例子:

- (void)viewDidLoad
{
[super viewDidLoad]; self.dotAnimation = [JTBorderDotAnimation new];
self.dotAnimation.animatedView = self.animatedView; self.dotAnimation.numberPoints = 6;
self.dotAnimation.duration = 6.;
self.dotAnimation.repeatCount = 3;
self.dotAnimation.pointSize = 5.;
self.dotAnimation.pointColor = [UIColor orangeColor];
}

Notes 注意

clipsToBounds property of the animatedView is set to NO at the beginning of the animation.

clipsToBounds这个属性在动画开始的时候是被设置成NO的.

You can also change the speed of the animation without stopping it with:

你也可以在做动画的过程中即时修改动画的速度:

    CALayer *layer = self.animatedView.layer;

    layer.timeOffset = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
layer.beginTime = CACurrentMediaTime();
layer.speed = 2.;

Requirements - 需要的环境

  • iOS 7 or higher iOS 7+
  • Automatic Reference Counting (ARC) ARC

Known Issues - 已知的问题

  • Animation stop when the application go in background, you have to restart it manually
  • 应用进入后台后,动画就会停止,你需要在进入前台后手动开启动画

Author - 作者

License - 协议

JTBorderDotAnimation is released under the MIT license. See the LICENSE file for more info.

[翻译] JTBorderDotAnimation的更多相关文章

  1. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  2. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  3. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  4. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  5. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  6. 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...

  7. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  8. 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?

    0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

随机推荐

  1. Springboot用官方建议访问Html页面并接传值

    Springboot用官方建议访问Html页面并接传值 我们以前通常习惯用webapp来防止jsp页面,但是到了Springboot中,官方建议用Static文件夹来存放及静态的资源, 用templa ...

  2. Can't find the 'libpq-fe.h header when trying to install pg gem

    https://stackoverflow.com/questions/6040583/cant-find-the-libpq-fe-h-header-when-trying-to-install-p ...

  3. 通过面试题,让我们来了解Collection

    前言 欢迎关注公众号:Coder编程 获取最新原创技术文章和相关免费学习资料,随时随地学习技术知识!** 本章主要介绍Collection集合相关知识,结合面试中会提到的相关问题进行知识点的梳理.希望 ...

  4. Hibernate5.1+Sqlserver2000分页查询

    前几天改到一个bug:从MS SQLserver上面同步表结构并且采集数据写入其他库.然后用的核心技术是用的Hibernate. 其中bug出在SQLServer2000版本上.排查下来发现2000版 ...

  5. [C语言]日期间天数差值的计算

    刷一些算法题时总能遇到计算日期间天数的问题,每每遇到这种情况,不是打开excel就是用系统自带的计算器.私以为这种问题及其简单以至于不需要自己动脑子,只要会调用工具就好.直到近些天在写一个日历程序的时 ...

  6. 王亮:游戏AI探索之旅——从alphago到moba游戏

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由云加社区技术沙龙 发表于云+社区专栏 演讲嘉宾:王亮,腾讯AI高级研究员.2013年加入腾讯,从事大数据预测以及游戏AI研发工作.目前 ...

  7. Http协议之Content-Length

    前言 http协议是互联网中最重要的协议之一,虽然看上去很简单,但是实际中经常遇到问题,我们就已经遇到好几次了.有长连接相关的,有报文解析相关的.对http协议不能一知半解,必须透彻理解才行.所以就写 ...

  8. Implicit super constructor xx() is undefined for default constructor. Must define an explicit constructor

      错误:Implicit super constructor xx() is undefined for default constructor. Must define an explicit c ...

  9. SQL Server中的小技巧(重复、替换、截取、去空格、去小数点后的位数)

    PS:随笔写的在SQL Server中要用到的 (重复.替换.截取.去空格.去小数点后的位数) /*---------------------------重复--------------------- ...

  10. C# 程序执行时间差

    有时需要知道执行一个方法需要多少时间,这时会用到一个时间差TimeSpan DateTime startTime = DateTime.Now;//方法开始时间 //{ // 你需要测试的代码. // ...