How to set the text color of TextView in code?
A1.
TextView text = (TextView) findViewById(R.id.text);
text.setTextColor(Color.parseColor("#FFFFFF"));
A2.
holder.text.setTextColor(Color.rgb(200,0,0));
You can also specify what color you want with Transparency. holder.text.setTextColor(Color.argb(0,200,0,0));
a for Alpha (Transparent) value r-red g-green b-blueA3.Adapter textview
Using Adapter you can set the text color by using this code:
|
Comments
Post a Comment