来自 IUView 的 CGLayer

发布于 2024-08-30 15:32:56 字数 77 浏览 2 评论 0原文

在 iPhone 或 iPad 上有人知道我们如何从 UIView 获取 CGLayer (不是 CALayer)吗?

问候

On iPhone or iPad someone know how we can get a CGLayer (not a CALayer) from an UIView?

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱给你人给你 2024-09-06 15:32:56

还没有尝试过,但我会这样做:

  1. 创建 CGLayer
  2. 通过调用 CGLayerGetContext() 获取图层的上下文。
  3. 使用[view.layer renderInContext:]将视图绘制到图层的图形上下文中。

Haven't tried this, but I would do it like this:

  1. Create the CGLayer
  2. Get the layer's context by calling CGLayerGetContext().
  3. Draw the view to the layer's graphics context with [view.layer renderInContext:].
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文