把colors.xml文件里配置的颜色值转成string
有个需求是需要传十六进制色值到后台,因为颜色值都配置在Colors.xml,所以需要转换一下,方法如下 colors.xml文件内容 stringBuffer.append(Integer.toHexString(red)); stringBuffer.append(Integer.toHexString(green)); stringBuffer.append(Integer.toHexString(blue)); LogUtils.d("changecolor="+stringBuffer.toString()); return stringBuffer.toString(); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |