[英]GetDrawable obsolete
I'm using a code from GitHub to change color of icons.我正在使用来自 GitHub 的代码来更改图标的颜色。 Unfortunately, there is one piece of the code that causes problems:
不幸的是,有一段代码导致了问题:
var d = Resources.GetDrawable(Element.Source).Mutate();
It tells me:它告诉我:
ResourceManager.GetDrawable(Resources, string)' is obsolete: 'GetDrawable(this Resources, string) is obsolete as of version 2.5.
ResourceManager.GetDrawable(Resources, string)' 已过时:'GetDrawable(this Resources, string) 自 2.5 版起已过时。 Please use GetDrawable(this Context, string) instead.
请改用 GetDrawable(this Context, string)。
Even though it seems to give me the solution to my problem, I still have trouble understanding what I should do.尽管它似乎给了我解决问题的方法,但我仍然无法理解我应该做什么。
该错误消息建议您改用Context.GetDrawable()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.