How to update Android Views upon modifications?

拈花ヽ惹草 提交于 2019-12-05 05:27:27
Thomas Dignan

Calling invalidate() will tell the view it needs to redraw itself (call onDraw) sometime in the future. So if you change something in your view, like the line thickness, call invalidate() after it. That way you know your view will eventually be updated.

All your drawing code should be implemented in onDraw() and your other methods should just change the state of your view, which will then be used to draw it, after you call invalidate().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!