最佳答案
我试图转换一个十六进制值为整型,以便我可以创建一个新的颜色绘制。我不确定这是否可行,但根据 文件,应该可行。它明显要求
Public ColorDrawable (int color)
在 API 级别1中添加创建具有指定的 颜色。
参数 颜色要绘制的颜色。
因此,我的代码无法工作,因为我得到了一个无效的 int: “ FF6666”错误。有什么办法吗?
int decode = Integer.decode("FF6666");
ColorDrawable colorDrawable = new ColorDrawable(decode);