What Shape Layers Are-CAShapeLayer
矢量图、gpu直接使用、占用内存小
What Shape Layers Are
Shape layers are layers capable of defining shapes as vectors. Because they’re defined as vectors, they are resolution-independent layers. At render time, Core Animation will create a bitmap that is the appropriate size to match the device’s screen scale. The result is that shape layers will always look crisp when drawn.1
Shape layers can be stroked and filled, and their lines’ properties can be adjusted as well. In true Core Animation fashion, shape layers also have many animatable properties, which allows developers to easily create compelling animations.2 Most importantly, CAShapeLayer is, unsurprisingly, rendered entirely on the GPU, making it very fast.3 With that said, let’s see how to create shape layers.
https://www.calayer.com/core-animation/2016/05/22/cashapelayer-in-depth.html
继承与,在创建时需要赋给,并且其形状是矩形的,而 的形状是根据特定的来决定的
CAShapeLayer
使用CAShapeLayer有以下一些优点:
- 渲染快速。CAShapeLayer使用了硬件加速,绘制同一图形会比用Core Graphics快很多。
- 高效使用内存。一个CAShapeLayer不需要像普通CALayer一样创建一个寄宿图形,所以无论有多大,都不会占用太多的内存。
- 不会被图层边界剪裁掉。一个CAShapeLayer可以在边界之外绘制。你的图层路径不会像在使用Core Graphics的普通CALayer一样被剪裁掉(如我们在第二章所见)。
- 不会出现像素化。当你给CAShapeLayer做3D变换时,它不像一个有寄宿图的普通图层一样变得像素化。
https://www.cnblogs.com/jingdizhiwa/p/5535619.html
What Shape Layers Are-CAShapeLayer的更多相关文章
- CAShapeLayer的path动画
CAShapeLayer的path动画 效果 源码 https://github.com/YouXianMing/Animations // // CAShapeLayerPathController ...
- iOS开发——Metal教程
Metal Swift教程 学习使用苹果GPU加速3D绘图的新API:Metal! 在iOS 8里,苹果发布了一个新的接口叫做Metal,它是一个支持GPU加速3D绘图的API. Meta ...
- iOS开发之 Lottie -- 炫酷的动效
动效在软件开发中非常常见,炫酷的动画能提升应用的B格,然而由设计师的设计转化成程序猿GG的代码是个非常"痛苦"的过程.对于复杂动画,可能要花费很多时间去研究和实现.Lottie 的 ...
- VEMap.DeleteAllShapeLayers 方法
来源:https://msdn.microsoft.com/zh-cn/library/bb412514.aspx <!DOCTYPE html PUBLIC "-//W3C//DTD ...
- CorelDRAW和Illustrator比较, 9 CorelDRAW Graphics Alternatives
至于要不要学Illustrator,完全凭个人意愿.如果你精通Coreldraw,学不学都一样.因为二者几乎可以完全替代. CDR:是一个纯图形设计软件.排版比其他二个软件好用. 一般来讲CDR更适合 ...
- WAF 强化学习
参考:https://github.com/duoergun0729/3book/tree/master/code/gym-waf 代码: wafEnv.py #-*- coding:utf-8 –* ...
- iOS开发——图形编程Swift篇&CAShapeLayer实现圆形图片加载动画
CAShapeLayer实现圆形图片加载动画 几个星期之前,Michael Villar在Motion试验中创建一个非常有趣的加载动画. 下面的GIF图片展示这个加载动画,它将一个圆形进度指示器和圆形 ...
- 使用CAShapeLayer来实现圆形图片加载动画[译]
原文链接 : How To Implement A Circular Image Loader Animation with CAShapeLayer 原文作者 : Rounak Jain 译文出自 ...
- 6 Specialzed layers 特殊层 第一部分 读书笔记
6 Specialzed layers 特殊层 第一部分 读书笔记 Specialization is a feature of every complex organization. 专注是 ...
随机推荐
- MySQL---7、常用操作
1.表列的添加.修改和删除 2.视图 3.字符集和校对集 4.触发器相关知识
- linux运维工程师成长过程
原文地址:https://blog.csdn.net/kwame211/article/details/78059331 初级篇 linux运维人员常用工具拓扑详见: 1rsync工具 很多地方经常会 ...
- 十四、ReentrantLock重入锁
一.简介 JDK提供了Lock接口来实现更丰富的锁控制,ReentrantLock即Lock接口的实现 JDK文档:http://tool.oschina.net/uploads/apidocs/jd ...
- vertical-align属性baseline(转)
图7-34 文字和图片内容默认垂直对齐方式为基线对齐 上一小节讲解了行高与单行纯文字的垂直居中,而如果行内含有图片和文字,在浏览器内浏览时,读者可以发现文字和图片在垂直方向并不是沿中线居中,而是沿基线 ...
- [LeetCode]Delete and Earn题解(动态规划)
Delete and Earn Given an array nums of integers, you can perform operations on the array. In each op ...
- hadoop classpath 的作用
HADOOP_CLASSPATH 是设置要运行的类的路径.否则当你用hadoop classname [args]方式运行程序时会报错,说找不到要运行的类.用hadoop jar jar_name.j ...
- Java:反射与代理
Java世界的繁荣反射这一特性有很大功劳,可以获取全面的类型信息. /** * */ package ref; import java.lang.reflect.Field; import java. ...
- [转]Shared——回调函数是什么
本文内容转自知乎 作者:no.body 链接:https://www.zhihu.com/question/19801131/answer/27459821 回调函数(callback)是什么? 什么 ...
- input一些验证
这篇博文大部分来自于网上,为了方便自己查阅,以及帮助他人. 1.正则验证只能输入正整数: onkeyup = " if (this.value.length==1) { this.valu ...
- JavaScript - 收藏集 - 掘金
Angular 中的响应式编程 -- 浅淡 Rx 的流式思维 - 掘金第一节:初识Angular-CLI第二节:登录组件的构建第三节:建立一个待办事项应用第四节:进化!模块化你的应用第五节:多用户版本 ...