[翻译] JTSlideShadowAnimation
JTSlideShadowAnimation

效果图:

JTSlideShadowAnimation allow you to reproduce the famous "slide to unlock effect" on iOS.
JTSlideShadowAnimation能让你重现巨好看的“锁屏滑动辉光”效果
Usage - 使用
Basic usage - 基本使用方法
Just import JTSlideShadowAnimation.h.
只要引入 JTSlideShadowAnimation.h 文件即可
#import "JTSlideShadowAnimation.h" @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UIButton *animatedView; @property (strong, nonatomic) JTSlideShadowAnimation *shadowAnimation; @end
Assign the view you want to animate and start the animation.
给你想要的view附上值,然后执行动画
- (void)viewDidLoad
{
[super viewDidLoad]; self.shadowAnimation = [JTSlideShadowAnimation new];
self.shadowAnimation.animatedView = self.animatedView;
} - (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated]; [self.shadowAnimation start];
}
Customization - 定制
You can easily customize the animation.
你可以简单定制以下的一些属性
shadowBackgroundColorshadowForegroundColorshadowWidthrepeatCountduration
Example:
例子:
- (void)viewDidLoad
{
[super viewDidLoad]; self.shadowAnimation = [JTSlideShadowAnimation new];
self.shadowAnimation.animatedView = self.animatedView; self.shadowAnimation.shadowBackgroundColor = [UIColor colorWithWhite:0. alpha:.3];
self.shadowAnimation.shadowForegroundColor = [UIColor blackColor];
self.shadowAnimation.shadowWidth = 40.;
self.shadowAnimation.repeatCount = 3;
self.shadowAnimation.duration = 3.; [self.shadowAnimation start];
}
Requirements - 需要的环境
- iOS 7 or higher iOS7或者更高版本
- Automatic Reference Counting (ARC) ARC
Known Issues - 已知的问题
- Animation stop when the application go in background, you have to restart it manually 程序进入后台然后进入前台时,动画会被移除,需要你手动重新开启
Author - 作者
License - 声明
JTSlideShadowAnimation is released under the MIT license. See the LICENSE file for more info.
JTSlideShadowAnimation基于MIT协议,你可以看看协议了解更多信息。
附录源码:
//
// ViewController.m
// ShowAnimation
//
// Created by YouXianMing on 14/12/26.
// Copyright (c) 2014年 YouXianMing. All rights reserved.
// #import "ViewController.h"
#import "JTSlideShadowAnimation.h" @interface ViewController () @property (strong, nonatomic) UIButton *animatedView;
@property (strong, nonatomic) JTSlideShadowAnimation *shadowAnimation; @end @implementation ViewController - (void)viewDidLoad {
[super viewDidLoad]; // 设置背景图片
UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
imageView.image = [UIImage imageNamed:@"background"];
imageView.contentMode = UIViewContentModeScaleAspectFill;
[self.view addSubview:imageView]; // 设置按钮
self.animatedView = [[UIButton alloc] initWithFrame:CGRectMake(, , , )];
self.animatedView.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Thin"
size:.f];
[self.animatedView setTitle:@"YouXianMing NoZuoNoDie"
forState:UIControlStateNormal];
[self.animatedView setTitleColor:[UIColor whiteColor]
forState:UIControlStateNormal];
[self.view addSubview:self.animatedView]; // 设置阴影
self.shadowAnimation = [JTSlideShadowAnimation new];
self.shadowAnimation.animatedView = self.animatedView;
[self.shadowAnimation start];
} @end
[翻译] JTSlideShadowAnimation的更多相关文章
- 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...
- 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...
- [翻译]开发文档:android Bitmap的高效使用
内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...
- 【探索】机器指令翻译成 JavaScript
前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...
- 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...
- 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...
- 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...
- 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?
0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点
在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...
随机推荐
- PHP 对目录下所有TXT进行遍历 并正则进行处理 preg_replace
<?php set_time_limit(); //遍历 指定目录下的所有 文件/ $pattern是要匹配的 文件规则 function file_list($dir,$pattern=&qu ...
- SecureCRTPortable的安装和使用(图文详解)
不多说,直接上干货! 玩玩这个远程连接软件,是个绿色软件. 别人已经做好了的. 解压之后, 下面,软件展示下, 这会默认去打开, 为了,方便,使用,放到桌面,作为快捷方式 成功 欢迎大家,加入我的微信 ...
- 使用Thumbnailator处理gif图片时遇到java.lang.ArrayIndexOutOfBoundsException: 4096异常处理
环境 1.7.0_80 在使用Thumbnailator处理gif图片时,遇到问题: Exception in thread "main" java.lang.ArrayIndex ...
- python-Lock进程同步解决互斥
#!/usr/bin/python from multiprocessing import Process,Lock import time,sys def A(lock): with lock: f ...
- 安装Ubunutu音频视频库
sudo apt-get install ubuntu-restricted-extras
- 群晖MyDS账号注册--实现使用QuickConnect外网访问
最近公司拿了个NAS给我,让我把它配置好,之前没有接触过这个东西,上网一查,发现就是和去年很火的玩客云和斐讯天天链N1的功能一样,可以实现文件储存和文件共享. 设备型号:群晖DS214SE 系统版本: ...
- 使用VNC访问Linux桌面
在一个严重依赖Windows的工作环境中,比如电子邮件被限定为Outlook(因为加密要求), VPN软件不支持Linux版本,那么,只使用Linux桌面是不够的,还需要在Linux桌面上跑个虚拟机运 ...
- selector.select()和selector.selectedKeys()
当调用selector.select()时会阻塞: This method performs a blocking selection operation. It returns only after ...
- ASP.NET MVC Core的ViewComponent
MVC Core新增了ViewComponent的概念,直接强行理解为视图组件,用于在页面上显示可重用的内容,这部分内容包括逻辑和展示内容,而且定义为组件那么其必定是可以独立存在并且是高度可重用的. ...
- 【angular5项目积累总结】一些正则积累
/^[1-9][0-9]{0,4}$/ /^[1-9][0-9]{0,4}(,[1-9][0-9]{0,4})*$/ /^([a-zA-Z0-9_\-])+\@(([a-zA-Z0-9\-])+\.) ...