****动画效果 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [UIView animateWithDuration: animations:^{ // 旋转 // _imageView.layer.transform = CATransform3DMakeRotation(M_PI, 1, 1, 0); // 平移 // _imageView.layer.transform = CATransform3D…
****动画组 // 核心动画都是假象,不能改变layer的真实属性的值// 展示的位置和实际的位置不同.实际位置永远在最开始位置 #import "HMViewController.h" @interface HMViewController () @property (weak, nonatomic) IBOutlet UIView *redView; @end @implementation HMViewController - (void)viewDidLoad { [supe…
*****HMViewController.m #import "HMViewController.h" #import "HMWheelView.h" @interface HMViewController () @property (nonatomic, weak) HMWheelView *wheelView; @end @implementation HMViewController - (IBAction)start:(id)sender { [_whee…
***翻页效果 #import "HMViewController.h" @interface HMViewController () @property (weak, nonatomic) IBOutlet UIImageView *imageView; @property (nonatomic, assign) int index; @end @implementation HMViewController - (void)viewDidLoad { [super viewDidL…
**** #import "HMViewController.h" // 每秒秒针转6度 #define perSecendA 6 // 每分钟分针转6度 #define perMinuteA 6 // 每小时时针转6度 #define perHourA 30 // 每分钟时针转6度 #define perMinuteHourA 0.5 #define angle2radian(x) ((x) / 180.0 * M_PI) @interface HMViewController ()…
A.基本知识 1.概念 Core Animation是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍,使用它需要先添加QuartzCore.framework和引入对应的框架<QuartzCore/QuartzCore.h>开发步骤:初始化一个动画对象(CAAnimation)并设置一些动画相关属性添加动画对象到层(CALayer)中,开始执行动画CALayer中很多属性都可以通过CAAnimation实现动画效果,包括:opacity.position.tr…
#import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UIView *redView; @property (weak, nonatomic) IBOutlet UIImageView *imageV; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]…
A.基本用法 1.CABasicAnimation // // ViewController.m // CoreAnimationTest // // Created by hellovoidworld on 15/1/14. // Copyright (c) 2015年 hellovoidworld. All rights reserved. // #import "ViewController.h" @interface ViewController () @property(no…
Core Animation是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍,使用它需要先添加QuartzCore.framework和引入对应的框架<QuartzCore/QuartzCore.h> Core Animation的使用,请参考最下面的博客. 由于Core Animation动画,改变的只是一个影子,实际的位置和尺寸都不会有变化.因而,在实际开发中,还是建议直接使用UIView动画. UIView动画 - (void)testViewSimpl…
- (void)createBaseAnimation{ //基础动画 CABasicAnimation *animation = [CABasicAnimation animation]; animation.keyPath = @"bounds"; //    animation.fromValue = [NSValue valueWithCGRect:CGRectMake(0, 0, 300, 300)];//默认为现在的状态 animation.toValue = [NSVal…