关于android失效?
现在,我有一个框架布局,它包含两个视图。当我调用顶部视图的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试添加
willNotDraw="true"
(参见此处) 符合您的观点,但我不确定这是否有帮助。You could try adding
willNotDraw="true"
(see here) to your view, but I'm not sure it helps.