settextcolor () parameter setting method
We got the information. SetTextColor () parameters can be written in the following form:
use color values directly
SetTextColor (0XFF0000FF);//0xff0000ff is the data of type int, group the 0x| Ff|0000ff,0x is a marker that represents a color integer, FF is a representation of transparency, 0000FF is a color, note: Here 0xff0000ff must be a color representation of 8, do not accept 0000FF as a color representation of this 6.
using the system's own color class
SetTextColor (Android.graphics.Color.BLUE);
set up using a resource file
SetTextColor (This.getresources (). GetColor (R.color.blue));//set by obtaining a resource file. Depending on the situation r.color.blue can also be r.string.blue or r.drawable.blue, of course, if necessary in the corresponding configuration file to do the corresponding configuration, such as:
<color name= "Blue" > #0000FF </color>
<drawable name= "Blue" > #0000FF </drawable>
<string name= "Blue" > #0000FF </string>
American and American pictures
Android Advanced (25) SetTextColor () parameter setting method