Core Animation笔记(变换)】的更多相关文章

1.仿射变换 CGAffineTransformMakeScale : CGAffineTransformMakeTranslation CGAffineTransformMakeRotation(CGFloat angle) CGAffineTransform scaleTrans = CGAffineTransformMakeScale(1.2, 1.2); CGAffineTransform tanslation = CGAffineTransformMakeTranslation(, )…
一.隐式动画 layer默认开启隐式动画 禁用隐式动画 [CATransaction setDisableActions:true]; 设置隐士动画时间 //默认0.25s [CATransaction setAnimationDuration:3.0]; //新启一个事务,防止对同一时间其他隐士动画产生影响   [CATransaction begin]; //默认0.25s [CATransaction setAnimationDuration:3.0]; //动画完成调用块 0.25s后调…
1.shapeLayer: 渲染快速,内存占用小,不会被图层边界裁掉(可以在边界之外绘制),不会像素化(当做3D变化如缩放是不会失真) CGRect rect = self.containerView.bounds; CAShapeLayer *shaper = [CAShapeLayer new]; shaper.backgroundColor = [UIColor yellowColor].CGColor; shaper.lineWidth = ; shaper.strokeColor =…
一.Layer的基本属性 1. contents 图层内容默认为nil 可以指定一张图片作为内容展示 self.layerView.layer.contents = (__bridge id)imag.CGImage; 2. contentsGravity 类似于contentMode的效果, 如kCAGravityCenter居中不拉伸, kCAGravityResize,自动缩放. 3. contentsScale 内容缩放因子,默认为1,一般都设置为屏幕的缩放 contensRect:内容…
第五章:Transforms   Affine Transforms   CGAffineTransform是二维的     Creating a CGAffineTransform   主要有三种变化方法 旋转: CGAffineTransformMakeRotation(CGFloat angle)     缩放: CGAffineTransformMakeScale(CGFloat sx, CGFloat sy)   移动: CGAffineTransformMakeTranslation…
转载. Book Description Publication Date: August 12, 2013 Core Animation is the technology underlying Apple’s iOS user interface. By unleashing the full power of Core Animation, you can enhance your app with impressive 2D and 3D visual effects and creat…
第六章:Specialized Layers   类别 用途 CAEmitterLayer 用于实现基于Core Animation粒子发射系统.发射器层对象控制粒子的生成和起源 CAGradientLayer 用于绘制一个颜色渐变填充图层的形状(所有圆角矩形边界内的部分) CAEAGLLayer/CAOpenGLLayer 用于设置需要使用OpenGL ES(iOS)或OpenGL(OS X)绘制的内容与内容储备. CAReplicatorLayer 当你想自动生成一个或多个子层的拷贝.复制器…
文件夹: The Layer Beneath The Layer Tree(图层树) The Backing Image(寄宿层) Layer Geometry(图层几何学) Visual Effects(视觉效果) Transforms(变换) Specialized Layers(专有图层) Setting Things in Motion Implicit Animations(隐式动画) Explicit Animations(显式动画) Layer Time(图层时间) Easing(…
原文地址http://www.cocoachina.com/ios/20150106/10840.html 延迟解压 一旦图片文件被加载就必须要进行解码,解码过程是一个相当复杂的任务,需要消耗非常长的时间.解码后的图片将同样使用相当大的内存. 用于加载的CPU时间相对于解码来说根据图片格式而不同.对于PNG图片来说,加载会比JPEG更长,因为文件可能更大,但是解码会相对较快,而且Xcode会把PNG图片进行解码优化之后引入工程.JPEG图片更小,加载更快,但是解压的步骤要消耗更长的时间,因为JP…
原文地址:http://www.cocoachina.com/ios/20150105/10827.html CAShapeLayer CAShapeLayer是一个通过矢量图形而不是bitmap来绘制的图层子类.你指定诸如颜色和线宽等属性,用CGPath来定义想要绘制的图形,最后CAShapeLayer就自动渲染出来了.当然,你也可以用Core Graphics直接向原始的CALayer的内容中绘制一个路径,相比直下,使用CAShapeLayer有以下一些优点: 渲染快速.CAShapeLay…