Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is default color for text in textview?

I set the color to red , and after that I want to set the color again back to default, but I do not know what is default color, does anyone knows ?

like image 562
Lukap Avatar asked Jun 24 '11 13:06

Lukap


People also ask

What is the default Colour for text?

First of all, the default font color (for the Normal style) is not black but Automatic (black on light colors, white on dark colors).

What is the default text color in HTML?

There is no default color defined in HTML. The "default color" is configured in the browser or by the operating system you are using.

Which property is used to color text in TextView in Android?

In XML, we can set a text color by the textColor attribute, like android:textColor="#FF0000" .

How do I change the color of TextView?

TextView Text Color – To change the color of text in TextView, you can set the color in layout XML file using textColor attribute or change the color dynamically in Kotlin file using setTextColor() method.


2 Answers

Actually the color TextView is:

android:textColor="@android:color/tab_indicator_text" 

or

#808080 
like image 51
Alex Zaraos Avatar answered Oct 21 '22 01:10

Alex Zaraos


You can save old color and then use it to restore the original value. Here is an example:

ColorStateList oldColors =  textView.getTextColors(); //save original colors textView.setTextColor(Color.RED); .... textView.setTextColor(oldColors);//restore original colors 

But in general default TextView text color is determined from current Theme applied to your Activity.

like image 20
inazaruk Avatar answered Oct 21 '22 02:10

inazaruk