[翻译] MotionBlur
MotionBlur

https://github.com/fastred/MotionBlur
MotionBlur allows you to add motion blur effect to your animations (currently only position's change). See the accompanying blog post to learn how it's implemented.
MotionBlur允许你添加动态模糊特效(目前只支持位移变化).你可以看这篇博文来看看是怎么实现的.

Note how the text and icons on the menu get blurred when it slides in and out.
注意看,这个文字以及图片会在滑入或者滑出的时候变得模糊了.
Usage
First, import it with:
首先,导入头文件:
#import "UIView+MotionBlur.h"
then use it with:
然后这么用:
[yourView enableBlurWithAngle:M_PI_2 completion:^{
[UIView animateWithDuration:0.5
delay:0
usingSpringWithDamping:0.8
initialSpringVelocity:0.3
options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState
animations:^{
CGRect f = yourView.frame;
f.origin = CGPointMake(0, 300);
yourView.frame = f;
} completion:^(BOOL finished) {
[yourView disableBlur];
}];
}];
Snapshot and blur are computed before the animation, that's why the API is asynchronous. You should also see the example project and read comments in the header file:Classes/UIView+MotionBlur.h.
截图以及模糊会在动画执行前就计算好了.所以,这是这个API为什么是异步的.你可以查看头文件来了解详情.
Demo
To run the example project; clone the repo and open Example/MotionBlur.xcodeproj.
Requirements
- iOS 8 and above
Installation
MotionBlur is available through CocoaPods. To install it, simply add the following line to your Podfile:
MotionBlur支持CocoaPods.
pod "MotionBlur"
Author
Arkadiusz Holko:
[翻译] MotionBlur的更多相关文章
- 《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 ...
随机推荐
- shell中的(),{}几种语法用法
转自:https://www.cnblogs.com/HKUI/p/6423918.html 查看脚本语法是否有错误:bash -n modify_suffix.sh跟踪执行sh -x modify_ ...
- Sklearn-RandomForest
在scikit-learn中,RandomForest的分类类是RandomForestClassifier,回归类是RandomForestRegressor,需要调参的参数包括两部分,第一部分是B ...
- java的NIO和AIO
1. 什么是NIO NIO是New I/O的简称,与旧式的基于流的I/O方法相对,从名字看,它表示新的一套Java I/O标 准.它是在Java 1.4中被纳入到JDK中的,并具有以下特性: NIO是 ...
- Nodejs学习笔记(五)—Express安装入门与模版引擎ejs
前言 前面也学习了一些Node.js的基本入门知道,现在开始进入Web开发的部分: Node.js提供了http模块,这个模块中提供了一些底层接口,可以直接使用,但是直接开发网站那还是太累了,所以ht ...
- spring中获取applicationContext
常用的5种获取spring 中bean的方式总结: 方法一:在初始化时保存ApplicationContext对象代码:ApplicationContext ac = new FileSystemXm ...
- 使用gitlab, jenkins搭建CI(持续集成)系统(2) -- 配置webhook触发构建
1. 在gitlab上配置192.168.1.30的ssh秘钥,使jenkins可以操作gitlab上的project 进入gitlab,点击右上角 点击 Settings -> SSH key ...
- Xcode DEBUG宏定义,debug和release模式的选择
设置DEBUG, 使用宏定义: #if DEBUG NSLog(@"debug model"); #else //执行release模式的代码 #endif
- 【原】使用Maven完成自动化打包并部署到Linux服务器下(Tomcat7)
最近在使用maven,顺便尝试了下tomcat部署.网上找到了很多资料但是都不是最新的,所以贴上比较新的Tomcat7部署代码和配置,方便以后回顾-->测试OK. 1. 首先是配置Tomcat ...
- Vue 基本指令和html常用标签结合使用综合案例(含代码)
最近项目中要开发一个OA审批:里边涉及到流程跳转(流程较多),具体方案有:直接下一步,选择参与人或者选择某一个流程之后再选择参与人: 我们前端是APiCloud开发,这里我主要使用Vue来实现,把实现 ...
- css的定位笔记
relative:相对定位. 1. 不论其父元素和相邻元素的position是什么,均相对于自身原来的位置来偏移. 2. 不会脱离文档流,其原来的位置依然保留着,不会被文档中其他的元素占用. 3. 原 ...