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…
A.基本知识 1.概念 Core Animation是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍,使用它需要先添加QuartzCore.framework和引入对应的框架<QuartzCore/QuartzCore.h>开发步骤:初始化一个动画对象(CAAnimation)并设置一些动画相关属性添加动画对象到层(CALayer)中,开始执行动画CALayer中很多属性都可以通过CAAnimation实现动画效果,包括:opacity.position.tr…
Core Animation是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍,使用它需要先添加QuartzCore.framework和引入对应的框架<QuartzCore/QuartzCore.h> Core Animation的使用,请参考最下面的博客. 由于Core Animation动画,改变的只是一个影子,实际的位置和尺寸都不会有变化.因而,在实际开发中,还是建议直接使用UIView动画. UIView动画 - (void)testViewSimpl…
1.UIView转场过渡动画   // // ViewController.m // UIViewAnimationTest // // Created by hellovoidworld on 15/1/16. // Copyright (c) 2015年 hellovoidworld. All rights reserved. // #import "ViewController.h" @interface ViewController () @property(nonatomic…
****动画组 // 核心动画都是假象,不能改变layer的真实属性的值// 展示的位置和实际的位置不同.实际位置永远在最开始位置 #import "HMViewController.h" @interface HMViewController () @property (weak, nonatomic) IBOutlet UIView *redView; @end @implementation HMViewController - (void)viewDidLoad { [supe…
A.需求 幸运广场界面中有一个幸运转盘,平时能够自动缓缓转动 能够选择星座 点击“开始选号”开速旋转转盘,旋转一定周数 转盘转动速度节奏:开始-慢-块-慢-结束 设置其余的背景和按钮   code source: 彩票Demo https://github.com/hellovoidworld/HelloLottery 转盘Demo https://github.com/hellovoidworld/LuckyWheelDemo       B.实现 1.使用xib设计转盘   2.自定义类 (…
A.简介 1. 需要掌握的 drawRect:方法的使用 常见图形的绘制:线条.多边形.圆 绘图状态的设置:文字颜色.线宽等 图形上下文状态的保存与恢复 图形上下文栈 1.基本图形绘制* 线段(线宽.线段样式)* 矩形(空心.实心.颜色)* 三角形.梯形等形状* 椭圆\圆* 圆弧* 文字绘制* 图片绘制(pattern)* 图形上下文栈 2.练习(画人) 3.模仿UIImageView 4.自定义checkbox 5.图片裁剪 6.图片水印 7.条纹背景 8.截图     2.概念 Quartz…
A.基本知识 1.需要掌握的 CALayer的基本属性 CALayer和UIView的关系 position和anchorPoint的作用   2.概念 在iOS中,你能看得见摸得着的东西基本上都是UIView,比如一个按钮.一个文本标签.一个文本输入框.一个图标等等,这些都是UIView 其实UIView之所以能显示在屏幕上,完全是因为它内部的一个图层 在创建UIView对象时,UIView内部会自动创建一个图层(即CALayer对象),通过UIView的layer属性可以访问这个层@prop…
概述 Quartz 2D是一个二维绘图引擎,同时支持iOS和Mac系统.Quartz 2D能完成的工作: 绘制图形 : 线条\三角形\矩形\圆\弧等 绘制文字 绘制\生成图片(图像) 读取\生成PDF 截图\裁剪图片 自定义UI控件 代码实现 绘制时,绘制内容必须写在-(void)drawRect:(CGRect)rect 这个方法内,因为在其它方法里,取不到图形上下文. 绘制线条 #import "LineView.h" @implementation LineView -(void…
****动画效果 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [UIView animateWithDuration: animations:^{ // 旋转 // _imageView.layer.transform = CATransform3DMakeRotation(M_PI, 1, 1, 0); // 平移 // _imageView.layer.transform = CATransform3D…