Animate change of view background color on Android
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do you animate the change of background color of a view on Android? For example: I have a view with a red background color. The background color of the view changes to blue. How can I do a smooth transition between colors? If this can't be done with views, an alternative will be welcome. 回答1: I ended up figuring out a (pretty good) solution for this problem! You can use a TransitionDrawable to accomplish this. For example, in an XML file in the drawable folder you could write something like: Then, in your XML for the actual View you