博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[翻译] Canvas 不用写代码的动画
阅读量:6950 次
发布时间:2019-06-27

本文共 2572 字,大约阅读时间需要 8 分钟。

Canvas 不用写代码的动画

Canvas is a project to simplify iOS development for both designers and developers. It had been difficult for designers to get hands on building the product with the lack of objective-c and Xcode experience, and a hard time for developer to use reasonable amount of time and lines of code just to achieve really simple effects.

With Canvas, creating stunning animations requires zero lines of code, trendy effects like the Parallax headers, Sticky sections, Blurred Backgrounds, will be as simple as few lines of code changes.

Canvas 是一个用来简化 iOS 设计的项目。对于初级开发者而言,如果连 Xcode 都用不顺手,甚至为了实现一个效果需要写好多好多的代码而苦逼。

使用 Canvas ,创建一个动画效果只需要一行代码,那些时髦的效果诸如视差、不动的区域、模糊化的背景,这些只需要几行代码。

 

Demo App

The demo app in this project uses , please run pod install after you download this project, then open Canvas.xcworkspace.

demo 使用的 CocoaPods,在下载这个应用之前,请先运行 pod install,之后再打开 Canvas.xcworkspace。

See this screencast in action:

Unable to build demo?

If you're getting some errors like Accelerate.framework not include, please update your CocoaPods version:

$ [sudo] gem install cocoapods

We also have a live demo avaliable at .

如果编译时提示了你有些错误如 Accelerate.framework not include ,请更新你的 CocoaPods 的版本:

 

Getting Started

If you're already on CocoaPods, installing our library is easy:

如果你已经有 CocoaPods 了,安装我们的库将会很容易:

$ edit Podfileplatform :ios, '7.0'pod 'Canvas', '~> 0.1'

Make sure you also update the dependencies by running this command afterwards:

确保你更新了依赖哦:

pod install

Then you should now have the Xcode workspace (.xcworkspace) ready.

现在你应该已经有工程文件了。

$open App.xcworkspace

That's it and you are good to go! See our  for hands on tutorial.

你可以在我们博客上看手把手教的教程。

 

How to Use

Using Interface Builder (no code required)

Specify the class CSAnimationView, and configurate the runtime attributes durationdelay, and type.

Please also get started with our more  on what Canvas can do.

指定这个 CSAnimationView,配置运行时的参数 duration,delay,以及 type。

你也可以从我们这个有着更多解释信息的项目demo中着手。

 

Using Code

It's very similar to using Interface Builder, instead you just setup the custom view in code.

与使用 IB 很类似,你也可以用几行代码来搞定。

CSAnimationView *animationView = [[CSAnimationView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];animationView.backgroundColor = [UIColor whiteColor];animationView.duration = 0.5;animationView.delay    = 0;animationView.type     = CSAnimationTypeMorph;[self.view addSubview:animationView];// Add your subviews into animationView// [animationView addSubview:<#(UIView *)#>]// Kick start the animation immediately[animationView startCanvasAnimation];

Requirements

iOS 7, Xcode 5

 

Who's behind?

  •  ()
  •  ()

 

 

 

 

 

转载地址:http://zbcil.baihongyu.com/

你可能感兴趣的文章
静态路由管理距离问题
查看>>
汽车常识全面介绍 - 引擎概论
查看>>
Android源码个个击破之Activity的渲染过程深入剖析
查看>>
C# 免费发邮件
查看>>
final关键字
查看>>
《Java程序员面试宝典》学习笔记(数据结构部分)
查看>>
[转载] 中华典故故事(孙刚)——29 拍马屁
查看>>
[转载] Discrete Mathematics——06 集合代数
查看>>
018,idea 下 如何集成 generator
查看>>
Java集合之队列和栈
查看>>
关于Oracle的一些学习简单知识
查看>>
基于Spring MVC框架的Http流程分析
查看>>
ios翻译
查看>>
《技术范儿》NO.3:畅谈数字时代存储变革之数据管理 ——随堂笔记
查看>>
grep
查看>>
保险数据调整结转前后处理
查看>>
大型网站技术架构(四)网站的高性能架构
查看>>
Mysql学习总结(11)——MySql存储过程与函数
查看>>
ubuntu增加swap空间
查看>>
命令 cd
查看>>