![]() |
1
4
calayer机器调用renderinContext来创建其位图内容属性。但是在cashapelayer中,path属性并没有实际呈现为其内容,如标题中的注释所示:
因此renderinContext不会将cashapelayer路径实际呈现到您的上下文中。不过,我自己还没试过。 |
![]() |
2
0
不知道它是否与您有关,但在针对renderinContext的Calayer文档中有一个注释,说明: **Important**: The Mac OS X v10.5 implementation of this method does not support the entire Core Animation composition model. QCCompositionLayer, CAOpenGLLayer, and QTMovieLayer layers are not rendered. Additionally, layers that use 3D transforms are not rendered, nor are layers that specify backgroundFilters, filters, compositingFilter, or a mask values. Future versions of Mac OS X may add support for rendering these layers and properties. 不管怎样,我在使用uiview drawrect函数和图像上下文中的绘图时遇到了类似的问题。如果我称之为drawrect,包含子视图的整个uiview将不会绘制其子视图(这实际上是有意义的,因为它在文档中说,如果您称之为drawrect,则不管super和subview实现如何,您都要负责填充整个区域)。我解决了我的问题,只是在所有的子视图上调用drawrect,将它们传递给它们自己的框架。 所以我建议你换掉renderincontext,用calayer的drawincontext来代替?您需要重写该方法,因为它在默认情况下不做任何事情。您的子类还需要将上下文移动到适当的框架中。为了安全起见,您可能希望检查您添加的代码是否不会影响这些层的正常呈现。 |
![]() |
3
0
我用雷达记录了这件事。我在文档中看不到它不应该工作的任何原因。如果苹果回复雷达,我会在这里回复。 |
![]() |
willThatBeAll · 如何在视图的直接层上启用动画? 6 年前 |
![]() |
Roi Mulia · 计算UIBezierPath曲线控制点 7 年前 |
![]() |
3366784 · CALayer子层在设备旋转期间不优美 7 年前 |
![]() |
Syngmaster · 带剪切段和阴影的UIView 7 年前 |
![]() |
Sweeper · 如何使自定义视图的背景色属性可设置动画? 7 年前 |