android textview怎么设置颜色
您可以使用setTextColor()
方法来设置TextView的颜色。以下是一个示例:
TextView textView = findViewById(R.id.textView);
textView.setTextColor(Color.RED);
您可以将Color.RED
替换为所需的颜色值,也可以使用getColor()
方法来获取资源文件中的颜色值。
相关问答
您可以使用setTextColor()
方法来设置TextView的颜色。以下是一个示例:
TextView textView = findViewById(R.id.textView);
textView.setTextColor(Color.RED);
您可以将Color.RED
替换为所需的颜色值,也可以使用getColor()
方法来获取资源文件中的颜色值。
相关问答
扫码添加客服微信