关于android失效?

发布于 2024-12-07 19:21:10 字数 152 浏览 5 评论 0原文

现在,我有一个框架布局,它包含两个视图。当我调用顶部视图的 invalidate() 方法时,我发现另一个视图的 onDraw() 也被调用。我想不应该调用另一个视图的 onDraw() ,有没有办法阻止 onDraw 被调用?

有人告诉 onDraw() 被调用的原因吗?

Now, I have a Framelayout, it includes two views. when I call the top view's invalidate() method, I found the another view's onDraw() also be called. I suppose the another view's onDraw() should not be called, Is there a way to stop the onDraw be called?

Is there someone tell the reason why onDraw() be called?

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

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

发布评论

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

评论(1

尴尬癌患者 2024-12-14 19:21:11

您可以尝试添加 willNotDraw="true" (参见此处) 符合您的观点,但我不确定这是否有帮助。

You could try adding willNotDraw="true" (see here) to your view, but I'm not sure it helps.

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