TextView tText = (TextView) findViewById (R. id. textv_name); // 1st types: tText. setTextColor (android. graphics. color. RED); // color class that comes with the system // 2nd types: tText. setTextColor (0xffff00ff); // 0xffffff00ff is int type data, grouped by 0x | ff | ff00ff, 0x indicates the color integer, ff indicates the transparency, and ff00ff indicates the color, note: Here, ffff00ff must be represented by 8 colors, and 6 colors such as ff00ff are not accepted. // Type 3rd: tText. setTextColor (android. graphics. color. parseColor (#87 CEFA); // use the Color class; // 4th types: tText. setTextColor (this. getResources (). getColor (R. color. red);/* Set it by obtaining the resource file. R. color. red can also be R. string. red or R. drawable. red, * Of course, the premise is that you need to configure the corresponding configuration file, such as (xml tag ):**
# FF0000
# FF0000
# FF0000
*/