[翻译] JTSlideShadowAnimation
翻译
2023-09-14 08:57:16 时间
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.
你可以简单定制以下的一些属性
shadowBackgroundColor shadowForegroundColor shadowWidth repeatCount durationExample:
例子:
- (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) ARCKnown Issues - 已知的问题
Animation stop when the application go in background, you have to restart it manually 程序进入后台然后进入前台时,动画会被移除,需要你手动重新开启Author - 作者
Jonathan Tribouharet (@johntribouharet)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; @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(0, 30, 320, 30)]; self.animatedView.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:20.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
上周去逛图书馆,借了本德语原版的书。今天突然想起来了,就翻开来看。我不知道这本书是否有中文版的,不管有没有吧,我尝试翻译一下以提高自身的德语水平。每天花上一个半小时来翻译,我想应该不能翻译出来几句的。
相关文章
- 招募译者翻译并发数据结构
- [翻译] SIAlertView
- [翻译] FeSpinner
- [翻译] ZFDragableModalTransition
- [翻译] FSLineChart
- [翻译] SlideInView
- [翻译] Fast Image Cache
- [翻译] GCDObjC
- [翻译] LASIImageView - 显示进度指示并异步下载图片
- Nginx官方文档翻译(转)
- WebSettings 文档 API 翻译 常用设置
- 发送语音+讯飞翻译 项目案例
- LSTM:《Understanding LSTM Networks》的翻译并解读
- 【SFA官方翻译】使用 Kubernetes、Spring Boot 2.0 和 Docker 的微服务快速指南
- 深度 | AI芯片之智能边缘计算的崛起——实时语言翻译、图像识别、AI视频监控、无人车这些都需要终端具有较强的计算能力,从而AI芯片发展起来是必然,同时5G网络也是必然