java 更改TextView颜色。 |||字体:https://stackoverflow.com/questions/8472349/how-to-set-text-color-to-a-text

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java 更改TextView颜色。 |||字体:https://stackoverflow.com/questions/8472349/how-to-set-text-color-to-a-text相关的知识,希望对你有一定的参考价值。

// API < 23
textView.setTextColor(getResources().getColor(R.color.some_color));

// API 23 or greater
textView.setTextColor(ContextCompat.getColor(context, R.color.some_color));

以上是关于java 更改TextView颜色。 |||字体:https://stackoverflow.com/questions/8472349/how-to-set-text-color-to-a-text的主要内容,如果未能解决你的问题,请参考以下文章