Canvas 是一个高效的iOS动画库使用起来也是非常简单的,一般情况下一句代码就差不多搞定了而且它的动画效果差不多也都可以由runtime Attribute的属性来进行实现的,在使用xib的情况下 一句 [self.view startCanvasAnimation]; 就可以实现动画效果了
-
通过xib的话只需要设置下就ok了
通过代码
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];
//添加你想增加效果的 View 为 animationView 的子视图
// [animationView addSubview:<#(UIView *)#>]
[animationView startCanvasAnimation];
Canvas 中提供的动画效果有29中 我最常用的是pop 当然 PopSDK中也提供了这种动画效果,至于如何选择就看各自的爱好了,接下来有空的话会整理一套Pop的动画效果作为比较的!
static CSAnimationType CSAnimationTypeBounceLeft = @"bounceLeft";
static CSAnimationType CSAnimationTypeBounceRight = @"bounceRight";
static CSAnimationType CSAnimationTypeBounceDown = @"bounceDown";
static CSAnimationType CSAnimationTypeBounceUp = @"bounceUp";
static CSAnimationType CSAnimationTypeFadeIn = @"fadeIn";
static CSAnimationType CSAnimationTypeFadeOut = @"fadeOut";
static CSAnimationType CSAnimationTypeFadeInLeft = @"fadeInLeft";
static CSAnimationType CSAnimationTypeFadeInRight = @"fadeInRight";
static CSAnimationType CSAnimationTypeFadeInDown = @"fadeInDown";
static CSAnimationType CSAnimationTypeFadeInUp = @"fadeInUp";
static CSAnimationType CSAnimationTypeSlideLeft = @"slideLeft";
static CSAnimationType CSAnimationTypeSlideRight = @"slideRight";
static CSAnimationType CSAnimationTypeSlideDown = @"slideDown";
static CSAnimationType CSAnimationTypeSlideUp = @"slideUp";
static CSAnimationType CSAnimationTypePop = @"pop";
static CSAnimationType CSAnimationTypeMorph = @"morph";
static CSAnimationType CSAnimationTypeFlash = @"flash";
static CSAnimationType CSAnimationTypeShake = @"shake";
static CSAnimationType CSAnimationTypeZoomIn = @"zoomIn";
static CSAnimationType CSAnimationTypeZoomOut = @"zoomOut";
static CSAnimationType CSAnimationTypeSlideDownReverse = @"slideDownReverse";
static CSAnimationType CSAnimationTypeFadeInSemi = @"fadeInSemi";
static CSAnimationType CSAnimationTypeFadeOutSemi = @"fadeOutSemi";
static CSAnimationType CSAnimationTypeFadeOutRight = @"fadeOutRight";
static CSAnimationType CSAnimationTypeFadeOutLeft = @"fadeOutLeft";
static CSAnimationType CSAnimationTypePopDown = @"popDown";
static CSAnimationType CSAnimationTypePopAlpha = @"popAlpha";
static CSAnimationType CSAnimationTypePopAlphaUp = @"popAlphaUp";
static CSAnimationType CSAnimationTypePopAlphaOut = @"popAlphaOut";