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.
我想复制现有的 UIView 及其所有子视图。复制的视图将用作动画的一部分,之后将不再需要它。
我注意到 UIView 没有实现 copyWithZone。有没有一种基于现有视图创建视图的简单方法?还是我需要使用提供给原始视图的参数手动设置视图?
或者,创建视图图像并将其用于我的动画会更好吗?
您确定需要整个视图层次结构吗?您可以使用 -[CALayer renderInContext:] 将视图渲染为图像并使用它吗?