温馨提示×

android textview怎么设置颜色

小亿
89
2024-01-26 11:16:52
栏目: 编程语言

您可以使用setTextColor()方法来设置TextView的颜色。以下是一个示例:

TextView textView = findViewById(R.id.textView);
textView.setTextColor(Color.RED);

您可以将Color.RED替换为所需的颜色值,也可以使用getColor()方法来获取资源文件中的颜色值。

0