[翻译] 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 - 作者

License - 协议

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

目录
相关文章
|
安全
阿里云短信服务是可以发送包含下载链接的文本内容的,
阿里云短信服务是可以发送包含下载链接的文本内容的,但是需要注意以下几点:
1022 1
|
9月前
|
Java
@Inherited 注解的作用
@Inherited 注解的作用
|
Linux
CentOS系统版本的查看方法
CentOS系统版本的查看方法CentOS系统版本的查看方法 查看操作系统版本1 复制代码1 [root@aliyun ~]# lsb_release -a2 LSB Version: :core-4.
7992 0
|
调度 Docker 容器
【赵渝强老师】Docker Swarm集群的体系架构
Docker Swarm自1.12.0版本起集成至Docker引擎,无需单独安装。它内置服务发现功能,支持跨多服务器或宿主机创建容器,形成集群提供服务。相比之下,Docker Compose仅限于单个宿主机。Docker Swarm采用主从架构,Swarm Manager负责管理和调度集群中的容器资源,用户通过其接口发送指令,Swarm Node根据指令创建容器运行应用。
225 0
|
敏捷开发 持续交付 项目管理
敏捷开发下如何选择高效的协同工具?提升研发团队项目管理与沟通效率的建议
本文介绍了6款适用于软件研发团队的协同工具,包括板栗看板、Jira、Trello、Slack、GitLab和Asana,涵盖了任务管理、版本控制、文档协作等方面。每款工具都有其独特的优势和适用场景,如板栗看板适合敏捷开发的小型团队,Jira适用于大型项目的复杂管理,Trello以简洁易用著称,Slack强化团队沟通,GitLab支持CI/CD流程,Asana则擅长跨团队协作。选择合适的工具能有效提升团队效率和项目管理能力。
敏捷开发下如何选择高效的协同工具?提升研发团队项目管理与沟通效率的建议
|
12月前
|
人工智能 关系型数据库 数据处理
快速构建,JeeLowCode让你的应用开发速度飞起来#快速开发
低代码平台通过直观的图形化界面和模块化设计,大幅缩短开发时间,降低成本,使企业无需大量技术人员即可快速构建应用。平台支持多种数据库、数据处理与管理,具备高效引擎和丰富的插件生态,帮助企业快速应对市场变化,推动数字化转型。演示地址:http://demo.jeelowcode.com/ 官网地址:http://www.jeelowcode.com
HTML标签之文字滚动效果(跑马灯效果)
HTML标签之文字滚动效果(跑马灯效果)
|
前端开发 API 开发者
layui:从崛起到蜕变,前端框架的华丽篇章
layui:从崛起到蜕变,前端框架的华丽篇章
|
运维 小程序 API
社区每周丨支付宝小程序导航栏升级及人脸认证计费规则更新
社区每周丨支付宝小程序导航栏升级及人脸认证计费规则更新
405 0
|
关系型数据库 MySQL Java
12-微服务技术栈(高级):容器引擎Docker
在前面的学习中,我们掌握了微服务的服务注册与发现(nacos)、配置中心(nacos)、远程服务调用(feign)、网关(gateway),同时借助Idea编译工具多次完成本地服务启动、部署和验证。在微服务架构中,不会再像传统那样单个单个部署服务器,而是会借助Docker进行批量的容器化部署。
1792 0