Canvas View 关系到底是什么?

发布于 2024-12-13 00:10:46 字数 293 浏览 0 评论 0原文

我正在查看 如何在屏幕上拖动东西,我唯一的困惑是传入的 Canvas c 对象到底是什么?

这个View是否占据了整个屏幕?如果将其设置为布局的子级怎么办?是否有多个画布(每个显示项一个),或者是否有一个整体画布来渲染所有内容?

我很难想象幕后发生的事情。

I'm looking at this example of how to drag things around the screen and my only point of confusion is what exactly IS the Canvas c object being passed in?

Is this View occupying the entire screen? What if it's set as the child to a Layout? Are there multiple canvases (one for each display item) or is there one overall Canvas upon which all things are rendered?

I'm having a hard time picturing what's happening beneath the hood.

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

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

发布评论

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

评论(1

酒中人 2024-12-20 00:10:46

画布是屏幕的整个可绘制区域。您应该保持在视图设置的范围内,但实际上没有什么可以阻止您到处绘图。

The Canvas is the entire drawable area of the screen. You're supposed to stay within the bounds that the view has set, but in reality there's nothing stopping you from drawing all over.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文