Questions tagged «colordrawable»

6
创建一个新的可绘制颜色
我正在尝试将十六进制值转换为int,以便创建新的可绘制颜色。我不确定是否可以,但是根据文档,应该可以。它明确地要求 公共ColorDrawable(int颜色) 在API级别1中添加。创建具有指定颜色的新ColorDrawable。 参数 color 绘制的颜色。 因此,我的代码无法正常工作,因为我收到一个无效的int:“ FF6666”错误。有任何想法吗? int decode = Integer.decode("FF6666"); ColorDrawable colorDrawable = new ColorDrawable(decode);
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.