当前位置: 首页 > news >正文

[翻译] JTBorderDotAnimation

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 - 作者

  • Jonathan Tribouharet (@johntribouharet)

License - 协议

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

 

相关文章:

  • 2019春总结作业
  • bzoj1202
  • 内存泄露
  • HTML5标准学习 - 编码
  • iOS内存管理规则
  • javaBean规范
  • Scala基础知识笔记0-参考链接
  • 关于Thread类中三个interrupt方法的研究与学习(转)
  • Dynamics CRM2013 Server2012R2下部署ADFS和IFD遇到的问题
  • 小气的Static,坚强的Const,疑惑的Typedef,还有居安思危的Volatile
  • hibernate中持久化对象的生命周期(三态:自由态,持久态,游离态 之间的转换)...
  • Query DSL for elasticsearch Query
  • oracle导入导出exp,imp
  • 关于Assembly.CreateInstance()与Activator.CreateInstance()方法
  • mysql 加入列,改动列,删除列。
  • 【跃迁之路】【641天】程序员高效学习方法论探索系列(实验阶段398-2018.11.14)...
  • iBatis和MyBatis在使用ResultMap对应关系时的区别
  • JavaScript 基本功--面试宝典
  • JavaScript学习总结——原型
  • Java-详解HashMap
  • js 实现textarea输入字数提示
  • LeetCode刷题——29. Divide Two Integers(Part 1靠自己)
  • Map集合、散列表、红黑树介绍
  • Nginx 通过 Lua + Redis 实现动态封禁 IP
  • React-生命周期杂记
  • Spring技术内幕笔记(2):Spring MVC 与 Web
  • 阿里云购买磁盘后挂载
  • 程序员该如何有效的找工作?
  • 翻译 | 老司机带你秒懂内存管理 - 第一部(共三部)
  • 分享自己折腾多时的一套 vue 组件 --we-vue
  • 复杂数据处理
  • 将 Measurements 和 Units 应用到物理学
  • 使用Gradle第一次构建Java程序
  • #周末课堂# 【Linux + JVM + Mysql高级性能优化班】(火热报名中~~~)
  • (PHP)设置修改 Apache 文件根目录 (Document Root)(转帖)
  • (笔试题)分解质因式
  • (附源码)spring boot基于小程序酒店疫情系统 毕业设计 091931
  • (附源码)spring boot建达集团公司平台 毕业设计 141538
  • (附源码)springboot炼糖厂地磅全自动控制系统 毕业设计 341357
  • (紀錄)[ASP.NET MVC][jQuery]-2 純手工打造屬於自己的 jQuery GridView (含完整程式碼下載)...
  • (数位dp) 算法竞赛入门到进阶 书本题集
  • *Django中的Ajax 纯js的书写样式1
  • *ST京蓝入股力合节能 着力绿色智慧城市服务
  • .Net - 类的介绍
  • .NET core 自定义过滤器 Filter 实现webapi RestFul 统一接口数据返回格式
  • .NET DataGridView数据绑定说明
  • .net framework4与其client profile版本的区别
  • .NET 将多个程序集合并成单一程序集的 4+3 种方法
  • .NET/C# 将一个命令行参数字符串转换为命令行参数数组 args
  • .net对接阿里云CSB服务
  • .NET国产化改造探索(三)、银河麒麟安装.NET 8环境
  • @Autowired和@Resource的区别
  • [ 常用工具篇 ] POC-bomber 漏洞检测工具安装及使用详解
  • [ 云计算 | AWS 实践 ] Java 如何重命名 Amazon S3 中的文件和文件夹
  • [AX]AX2012开发新特性-禁止表或者表字段