Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
CALayer 存在的目的是什么,我稍微习惯了。为什么不把属性放在 UIView 中呢?
谢谢。
CALayer 代表与 UIView 完全不同的“事物”。CALayer 只处理绘图本身,并封装执行此操作所需的信息。另一方面,视图拥有一个或多个图层,用于绘制自身。不过,视图还有许多其他功能和属性,与它在屏幕上的表示无关。
我建议深入研究 Apple 文档,也许还可以拿起一本关于面向对象编码的书。